{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoT.Types.CACertificateDescription
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoT.Types.CACertificateDescription where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.AutoRegistrationStatus
import Amazonka.IoT.Types.CACertificateStatus
import Amazonka.IoT.Types.CertificateValidity
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes a CA certificate.
--
-- /See:/ 'newCACertificateDescription' smart constructor.
data CACertificateDescription = CACertificateDescription'
  { -- | The status of a CA certificate.
    CACertificateDescription -> Maybe CACertificateStatus
status :: Prelude.Maybe CACertificateStatus,
    -- | The owner of the CA certificate.
    CACertificateDescription -> Maybe Text
ownedBy :: Prelude.Maybe Prelude.Text,
    -- | The date the CA certificate was last modified.
    CACertificateDescription -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Core.POSIX,
    -- | The CA certificate data, in PEM format.
    CACertificateDescription -> Maybe Text
certificatePem :: Prelude.Maybe Prelude.Text,
    -- | The CA certificate ARN.
    CACertificateDescription -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
    -- | The CA certificate ID.
    CACertificateDescription -> Maybe Text
certificateId :: Prelude.Maybe Prelude.Text,
    -- | When the CA certificate is valid.
    CACertificateDescription -> Maybe CertificateValidity
validity :: Prelude.Maybe CertificateValidity,
    -- | Whether the CA certificate configured for auto registration of device
    -- certificates. Valid values are \"ENABLE\" and \"DISABLE\"
    CACertificateDescription -> Maybe AutoRegistrationStatus
autoRegistrationStatus :: Prelude.Maybe AutoRegistrationStatus,
    -- | The date the CA certificate was created.
    CACertificateDescription -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | The generation ID of the CA certificate.
    CACertificateDescription -> Maybe Text
generationId :: Prelude.Maybe Prelude.Text,
    -- | The customer version of the CA certificate.
    CACertificateDescription -> Maybe Natural
customerVersion :: Prelude.Maybe Prelude.Natural
  }
  deriving (CACertificateDescription -> CACertificateDescription -> Bool
(CACertificateDescription -> CACertificateDescription -> Bool)
-> (CACertificateDescription -> CACertificateDescription -> Bool)
-> Eq CACertificateDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CACertificateDescription -> CACertificateDescription -> Bool
$c/= :: CACertificateDescription -> CACertificateDescription -> Bool
== :: CACertificateDescription -> CACertificateDescription -> Bool
$c== :: CACertificateDescription -> CACertificateDescription -> Bool
Prelude.Eq, ReadPrec [CACertificateDescription]
ReadPrec CACertificateDescription
Int -> ReadS CACertificateDescription
ReadS [CACertificateDescription]
(Int -> ReadS CACertificateDescription)
-> ReadS [CACertificateDescription]
-> ReadPrec CACertificateDescription
-> ReadPrec [CACertificateDescription]
-> Read CACertificateDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CACertificateDescription]
$creadListPrec :: ReadPrec [CACertificateDescription]
readPrec :: ReadPrec CACertificateDescription
$creadPrec :: ReadPrec CACertificateDescription
readList :: ReadS [CACertificateDescription]
$creadList :: ReadS [CACertificateDescription]
readsPrec :: Int -> ReadS CACertificateDescription
$creadsPrec :: Int -> ReadS CACertificateDescription
Prelude.Read, Int -> CACertificateDescription -> ShowS
[CACertificateDescription] -> ShowS
CACertificateDescription -> String
(Int -> CACertificateDescription -> ShowS)
-> (CACertificateDescription -> String)
-> ([CACertificateDescription] -> ShowS)
-> Show CACertificateDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CACertificateDescription] -> ShowS
$cshowList :: [CACertificateDescription] -> ShowS
show :: CACertificateDescription -> String
$cshow :: CACertificateDescription -> String
showsPrec :: Int -> CACertificateDescription -> ShowS
$cshowsPrec :: Int -> CACertificateDescription -> ShowS
Prelude.Show, (forall x.
 CACertificateDescription -> Rep CACertificateDescription x)
-> (forall x.
    Rep CACertificateDescription x -> CACertificateDescription)
-> Generic CACertificateDescription
forall x.
Rep CACertificateDescription x -> CACertificateDescription
forall x.
CACertificateDescription -> Rep CACertificateDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CACertificateDescription x -> CACertificateDescription
$cfrom :: forall x.
CACertificateDescription -> Rep CACertificateDescription x
Prelude.Generic)

-- |
-- Create a value of 'CACertificateDescription' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'cACertificateDescription_status' - The status of a CA certificate.
--
-- 'ownedBy', 'cACertificateDescription_ownedBy' - The owner of the CA certificate.
--
-- 'lastModifiedDate', 'cACertificateDescription_lastModifiedDate' - The date the CA certificate was last modified.
--
-- 'certificatePem', 'cACertificateDescription_certificatePem' - The CA certificate data, in PEM format.
--
-- 'certificateArn', 'cACertificateDescription_certificateArn' - The CA certificate ARN.
--
-- 'certificateId', 'cACertificateDescription_certificateId' - The CA certificate ID.
--
-- 'validity', 'cACertificateDescription_validity' - When the CA certificate is valid.
--
-- 'autoRegistrationStatus', 'cACertificateDescription_autoRegistrationStatus' - Whether the CA certificate configured for auto registration of device
-- certificates. Valid values are \"ENABLE\" and \"DISABLE\"
--
-- 'creationDate', 'cACertificateDescription_creationDate' - The date the CA certificate was created.
--
-- 'generationId', 'cACertificateDescription_generationId' - The generation ID of the CA certificate.
--
-- 'customerVersion', 'cACertificateDescription_customerVersion' - The customer version of the CA certificate.
newCACertificateDescription ::
  CACertificateDescription
newCACertificateDescription :: CACertificateDescription
newCACertificateDescription =
  CACertificateDescription' :: Maybe CACertificateStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CertificateValidity
-> Maybe AutoRegistrationStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Natural
-> CACertificateDescription
CACertificateDescription'
    { $sel:status:CACertificateDescription' :: Maybe CACertificateStatus
status = Maybe CACertificateStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:ownedBy:CACertificateDescription' :: Maybe Text
ownedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:CACertificateDescription' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:certificatePem:CACertificateDescription' :: Maybe Text
certificatePem = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateArn:CACertificateDescription' :: Maybe Text
certificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateId:CACertificateDescription' :: Maybe Text
certificateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:validity:CACertificateDescription' :: Maybe CertificateValidity
validity = Maybe CertificateValidity
forall a. Maybe a
Prelude.Nothing,
      $sel:autoRegistrationStatus:CACertificateDescription' :: Maybe AutoRegistrationStatus
autoRegistrationStatus = Maybe AutoRegistrationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:CACertificateDescription' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:generationId:CACertificateDescription' :: Maybe Text
generationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customerVersion:CACertificateDescription' :: Maybe Natural
customerVersion = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of a CA certificate.
cACertificateDescription_status :: Lens.Lens' CACertificateDescription (Prelude.Maybe CACertificateStatus)
cACertificateDescription_status :: (Maybe CACertificateStatus -> f (Maybe CACertificateStatus))
-> CACertificateDescription -> f CACertificateDescription
cACertificateDescription_status = (CACertificateDescription -> Maybe CACertificateStatus)
-> (CACertificateDescription
    -> Maybe CACertificateStatus -> CACertificateDescription)
-> Lens
     CACertificateDescription
     CACertificateDescription
     (Maybe CACertificateStatus)
     (Maybe CACertificateStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CACertificateDescription' {Maybe CACertificateStatus
status :: Maybe CACertificateStatus
$sel:status:CACertificateDescription' :: CACertificateDescription -> Maybe CACertificateStatus
status} -> Maybe CACertificateStatus
status) (\s :: CACertificateDescription
s@CACertificateDescription' {} Maybe CACertificateStatus
a -> CACertificateDescription
s {$sel:status:CACertificateDescription' :: Maybe CACertificateStatus
status = Maybe CACertificateStatus
a} :: CACertificateDescription)

-- | The owner of the CA certificate.
cACertificateDescription_ownedBy :: Lens.Lens' CACertificateDescription (Prelude.Maybe Prelude.Text)
cACertificateDescription_ownedBy :: (Maybe Text -> f (Maybe Text))
-> CACertificateDescription -> f CACertificateDescription
cACertificateDescription_ownedBy = (CACertificateDescription -> Maybe Text)
-> (CACertificateDescription
    -> Maybe Text -> CACertificateDescription)
-> Lens
     CACertificateDescription
     CACertificateDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CACertificateDescription' {Maybe Text
ownedBy :: Maybe Text
$sel:ownedBy:CACertificateDescription' :: CACertificateDescription -> Maybe Text
ownedBy} -> Maybe Text
ownedBy) (\s :: CACertificateDescription
s@CACertificateDescription' {} Maybe Text
a -> CACertificateDescription
s {$sel:ownedBy:CACertificateDescription' :: Maybe Text
ownedBy = Maybe Text
a} :: CACertificateDescription)

-- | The date the CA certificate was last modified.
cACertificateDescription_lastModifiedDate :: Lens.Lens' CACertificateDescription (Prelude.Maybe Prelude.UTCTime)
cACertificateDescription_lastModifiedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CACertificateDescription -> f CACertificateDescription
cACertificateDescription_lastModifiedDate = (CACertificateDescription -> Maybe POSIX)
-> (CACertificateDescription
    -> Maybe POSIX -> CACertificateDescription)
-> Lens
     CACertificateDescription
     CACertificateDescription
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CACertificateDescription' {Maybe POSIX
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:CACertificateDescription' :: CACertificateDescription -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: CACertificateDescription
s@CACertificateDescription' {} Maybe POSIX
a -> CACertificateDescription
s {$sel:lastModifiedDate:CACertificateDescription' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
a} :: CACertificateDescription) ((Maybe POSIX -> f (Maybe POSIX))
 -> CACertificateDescription -> f CACertificateDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CACertificateDescription
-> f CACertificateDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The CA certificate data, in PEM format.
cACertificateDescription_certificatePem :: Lens.Lens' CACertificateDescription (Prelude.Maybe Prelude.Text)
cACertificateDescription_certificatePem :: (Maybe Text -> f (Maybe Text))
-> CACertificateDescription -> f CACertificateDescription
cACertificateDescription_certificatePem = (CACertificateDescription -> Maybe Text)
-> (CACertificateDescription
    -> Maybe Text -> CACertificateDescription)
-> Lens
     CACertificateDescription
     CACertificateDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CACertificateDescription' {Maybe Text
certificatePem :: Maybe Text
$sel:certificatePem:CACertificateDescription' :: CACertificateDescription -> Maybe Text
certificatePem} -> Maybe Text
certificatePem) (\s :: CACertificateDescription
s@CACertificateDescription' {} Maybe Text
a -> CACertificateDescription
s {$sel:certificatePem:CACertificateDescription' :: Maybe Text
certificatePem = Maybe Text
a} :: CACertificateDescription)

-- | The CA certificate ARN.
cACertificateDescription_certificateArn :: Lens.Lens' CACertificateDescription (Prelude.Maybe Prelude.Text)
cACertificateDescription_certificateArn :: (Maybe Text -> f (Maybe Text))
-> CACertificateDescription -> f CACertificateDescription
cACertificateDescription_certificateArn = (CACertificateDescription -> Maybe Text)
-> (CACertificateDescription
    -> Maybe Text -> CACertificateDescription)
-> Lens
     CACertificateDescription
     CACertificateDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CACertificateDescription' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:CACertificateDescription' :: CACertificateDescription -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: CACertificateDescription
s@CACertificateDescription' {} Maybe Text
a -> CACertificateDescription
s {$sel:certificateArn:CACertificateDescription' :: Maybe Text
certificateArn = Maybe Text
a} :: CACertificateDescription)

-- | The CA certificate ID.
cACertificateDescription_certificateId :: Lens.Lens' CACertificateDescription (Prelude.Maybe Prelude.Text)
cACertificateDescription_certificateId :: (Maybe Text -> f (Maybe Text))
-> CACertificateDescription -> f CACertificateDescription
cACertificateDescription_certificateId = (CACertificateDescription -> Maybe Text)
-> (CACertificateDescription
    -> Maybe Text -> CACertificateDescription)
-> Lens
     CACertificateDescription
     CACertificateDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CACertificateDescription' {Maybe Text
certificateId :: Maybe Text
$sel:certificateId:CACertificateDescription' :: CACertificateDescription -> Maybe Text
certificateId} -> Maybe Text
certificateId) (\s :: CACertificateDescription
s@CACertificateDescription' {} Maybe Text
a -> CACertificateDescription
s {$sel:certificateId:CACertificateDescription' :: Maybe Text
certificateId = Maybe Text
a} :: CACertificateDescription)

-- | When the CA certificate is valid.
cACertificateDescription_validity :: Lens.Lens' CACertificateDescription (Prelude.Maybe CertificateValidity)
cACertificateDescription_validity :: (Maybe CertificateValidity -> f (Maybe CertificateValidity))
-> CACertificateDescription -> f CACertificateDescription
cACertificateDescription_validity = (CACertificateDescription -> Maybe CertificateValidity)
-> (CACertificateDescription
    -> Maybe CertificateValidity -> CACertificateDescription)
-> Lens
     CACertificateDescription
     CACertificateDescription
     (Maybe CertificateValidity)
     (Maybe CertificateValidity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CACertificateDescription' {Maybe CertificateValidity
validity :: Maybe CertificateValidity
$sel:validity:CACertificateDescription' :: CACertificateDescription -> Maybe CertificateValidity
validity} -> Maybe CertificateValidity
validity) (\s :: CACertificateDescription
s@CACertificateDescription' {} Maybe CertificateValidity
a -> CACertificateDescription
s {$sel:validity:CACertificateDescription' :: Maybe CertificateValidity
validity = Maybe CertificateValidity
a} :: CACertificateDescription)

-- | Whether the CA certificate configured for auto registration of device
-- certificates. Valid values are \"ENABLE\" and \"DISABLE\"
cACertificateDescription_autoRegistrationStatus :: Lens.Lens' CACertificateDescription (Prelude.Maybe AutoRegistrationStatus)
cACertificateDescription_autoRegistrationStatus :: (Maybe AutoRegistrationStatus -> f (Maybe AutoRegistrationStatus))
-> CACertificateDescription -> f CACertificateDescription
cACertificateDescription_autoRegistrationStatus = (CACertificateDescription -> Maybe AutoRegistrationStatus)
-> (CACertificateDescription
    -> Maybe AutoRegistrationStatus -> CACertificateDescription)
-> Lens
     CACertificateDescription
     CACertificateDescription
     (Maybe AutoRegistrationStatus)
     (Maybe AutoRegistrationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CACertificateDescription' {Maybe AutoRegistrationStatus
autoRegistrationStatus :: Maybe AutoRegistrationStatus
$sel:autoRegistrationStatus:CACertificateDescription' :: CACertificateDescription -> Maybe AutoRegistrationStatus
autoRegistrationStatus} -> Maybe AutoRegistrationStatus
autoRegistrationStatus) (\s :: CACertificateDescription
s@CACertificateDescription' {} Maybe AutoRegistrationStatus
a -> CACertificateDescription
s {$sel:autoRegistrationStatus:CACertificateDescription' :: Maybe AutoRegistrationStatus
autoRegistrationStatus = Maybe AutoRegistrationStatus
a} :: CACertificateDescription)

-- | The date the CA certificate was created.
cACertificateDescription_creationDate :: Lens.Lens' CACertificateDescription (Prelude.Maybe Prelude.UTCTime)
cACertificateDescription_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CACertificateDescription -> f CACertificateDescription
cACertificateDescription_creationDate = (CACertificateDescription -> Maybe POSIX)
-> (CACertificateDescription
    -> Maybe POSIX -> CACertificateDescription)
-> Lens
     CACertificateDescription
     CACertificateDescription
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CACertificateDescription' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:CACertificateDescription' :: CACertificateDescription -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: CACertificateDescription
s@CACertificateDescription' {} Maybe POSIX
a -> CACertificateDescription
s {$sel:creationDate:CACertificateDescription' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: CACertificateDescription) ((Maybe POSIX -> f (Maybe POSIX))
 -> CACertificateDescription -> f CACertificateDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CACertificateDescription
-> f CACertificateDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The generation ID of the CA certificate.
cACertificateDescription_generationId :: Lens.Lens' CACertificateDescription (Prelude.Maybe Prelude.Text)
cACertificateDescription_generationId :: (Maybe Text -> f (Maybe Text))
-> CACertificateDescription -> f CACertificateDescription
cACertificateDescription_generationId = (CACertificateDescription -> Maybe Text)
-> (CACertificateDescription
    -> Maybe Text -> CACertificateDescription)
-> Lens
     CACertificateDescription
     CACertificateDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CACertificateDescription' {Maybe Text
generationId :: Maybe Text
$sel:generationId:CACertificateDescription' :: CACertificateDescription -> Maybe Text
generationId} -> Maybe Text
generationId) (\s :: CACertificateDescription
s@CACertificateDescription' {} Maybe Text
a -> CACertificateDescription
s {$sel:generationId:CACertificateDescription' :: Maybe Text
generationId = Maybe Text
a} :: CACertificateDescription)

-- | The customer version of the CA certificate.
cACertificateDescription_customerVersion :: Lens.Lens' CACertificateDescription (Prelude.Maybe Prelude.Natural)
cACertificateDescription_customerVersion :: (Maybe Natural -> f (Maybe Natural))
-> CACertificateDescription -> f CACertificateDescription
cACertificateDescription_customerVersion = (CACertificateDescription -> Maybe Natural)
-> (CACertificateDescription
    -> Maybe Natural -> CACertificateDescription)
-> Lens
     CACertificateDescription
     CACertificateDescription
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CACertificateDescription' {Maybe Natural
customerVersion :: Maybe Natural
$sel:customerVersion:CACertificateDescription' :: CACertificateDescription -> Maybe Natural
customerVersion} -> Maybe Natural
customerVersion) (\s :: CACertificateDescription
s@CACertificateDescription' {} Maybe Natural
a -> CACertificateDescription
s {$sel:customerVersion:CACertificateDescription' :: Maybe Natural
customerVersion = Maybe Natural
a} :: CACertificateDescription)

instance Core.FromJSON CACertificateDescription where
  parseJSON :: Value -> Parser CACertificateDescription
parseJSON =
    String
-> (Object -> Parser CACertificateDescription)
-> Value
-> Parser CACertificateDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CACertificateDescription"
      ( \Object
x ->
          Maybe CACertificateStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CertificateValidity
-> Maybe AutoRegistrationStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Natural
-> CACertificateDescription
CACertificateDescription'
            (Maybe CACertificateStatus
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe CertificateValidity
 -> Maybe AutoRegistrationStatus
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Natural
 -> CACertificateDescription)
-> Parser (Maybe CACertificateStatus)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CertificateValidity
      -> Maybe AutoRegistrationStatus
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Natural
      -> CACertificateDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CACertificateStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CertificateValidity
   -> Maybe AutoRegistrationStatus
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Natural
   -> CACertificateDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CertificateValidity
      -> Maybe AutoRegistrationStatus
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Natural
      -> CACertificateDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ownedBy")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CertificateValidity
   -> Maybe AutoRegistrationStatus
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Natural
   -> CACertificateDescription)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CertificateValidity
      -> Maybe AutoRegistrationStatus
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Natural
      -> CACertificateDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastModifiedDate")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CertificateValidity
   -> Maybe AutoRegistrationStatus
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Natural
   -> CACertificateDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe CertificateValidity
      -> Maybe AutoRegistrationStatus
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Natural
      -> CACertificateDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"certificatePem")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe CertificateValidity
   -> Maybe AutoRegistrationStatus
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Natural
   -> CACertificateDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe CertificateValidity
      -> Maybe AutoRegistrationStatus
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Natural
      -> CACertificateDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"certificateArn")
            Parser
  (Maybe Text
   -> Maybe CertificateValidity
   -> Maybe AutoRegistrationStatus
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Natural
   -> CACertificateDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe CertificateValidity
      -> Maybe AutoRegistrationStatus
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Natural
      -> CACertificateDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"certificateId")
            Parser
  (Maybe CertificateValidity
   -> Maybe AutoRegistrationStatus
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Natural
   -> CACertificateDescription)
-> Parser (Maybe CertificateValidity)
-> Parser
     (Maybe AutoRegistrationStatus
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Natural
      -> CACertificateDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CertificateValidity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"validity")
            Parser
  (Maybe AutoRegistrationStatus
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Natural
   -> CACertificateDescription)
-> Parser (Maybe AutoRegistrationStatus)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe Natural -> CACertificateDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AutoRegistrationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"autoRegistrationStatus")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe Natural -> CACertificateDescription)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Natural -> CACertificateDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationDate")
            Parser (Maybe Text -> Maybe Natural -> CACertificateDescription)
-> Parser (Maybe Text)
-> Parser (Maybe Natural -> CACertificateDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"generationId")
            Parser (Maybe Natural -> CACertificateDescription)
-> Parser (Maybe Natural) -> Parser CACertificateDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"customerVersion")
      )

instance Prelude.Hashable CACertificateDescription

instance Prelude.NFData CACertificateDescription