{-# 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.CertificateDescription
-- 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.CertificateDescription where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.CertificateMode
import Amazonka.IoT.Types.CertificateStatus
import Amazonka.IoT.Types.CertificateValidity
import Amazonka.IoT.Types.TransferData
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes a certificate.
--
-- /See:/ 'newCertificateDescription' smart constructor.
data CertificateDescription = CertificateDescription'
  { -- | The status of the certificate.
    CertificateDescription -> Maybe CertificateStatus
status :: Prelude.Maybe CertificateStatus,
    -- | The ID of the Amazon Web Services account that owns the certificate.
    CertificateDescription -> Maybe Text
ownedBy :: Prelude.Maybe Prelude.Text,
    -- | The date and time the certificate was last modified.
    CertificateDescription -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Core.POSIX,
    -- | The certificate ID of the CA certificate used to sign this certificate.
    CertificateDescription -> Maybe Text
caCertificateId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon Web Services account of the previous owner of the
    -- certificate.
    CertificateDescription -> Maybe Text
previousOwnedBy :: Prelude.Maybe Prelude.Text,
    -- | The certificate data, in PEM format.
    CertificateDescription -> Maybe Text
certificatePem :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the certificate.
    CertificateDescription -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the certificate.
    CertificateDescription -> Maybe Text
certificateId :: Prelude.Maybe Prelude.Text,
    -- | The mode of the certificate.
    CertificateDescription -> Maybe CertificateMode
certificateMode :: Prelude.Maybe CertificateMode,
    -- | When the certificate is valid.
    CertificateDescription -> Maybe CertificateValidity
validity :: Prelude.Maybe CertificateValidity,
    -- | The date and time the certificate was created.
    CertificateDescription -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | The generation ID of the certificate.
    CertificateDescription -> Maybe Text
generationId :: Prelude.Maybe Prelude.Text,
    -- | The transfer data.
    CertificateDescription -> Maybe TransferData
transferData :: Prelude.Maybe TransferData,
    -- | The customer version of the certificate.
    CertificateDescription -> Maybe Natural
customerVersion :: Prelude.Maybe Prelude.Natural
  }
  deriving (CertificateDescription -> CertificateDescription -> Bool
(CertificateDescription -> CertificateDescription -> Bool)
-> (CertificateDescription -> CertificateDescription -> Bool)
-> Eq CertificateDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CertificateDescription -> CertificateDescription -> Bool
$c/= :: CertificateDescription -> CertificateDescription -> Bool
== :: CertificateDescription -> CertificateDescription -> Bool
$c== :: CertificateDescription -> CertificateDescription -> Bool
Prelude.Eq, ReadPrec [CertificateDescription]
ReadPrec CertificateDescription
Int -> ReadS CertificateDescription
ReadS [CertificateDescription]
(Int -> ReadS CertificateDescription)
-> ReadS [CertificateDescription]
-> ReadPrec CertificateDescription
-> ReadPrec [CertificateDescription]
-> Read CertificateDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CertificateDescription]
$creadListPrec :: ReadPrec [CertificateDescription]
readPrec :: ReadPrec CertificateDescription
$creadPrec :: ReadPrec CertificateDescription
readList :: ReadS [CertificateDescription]
$creadList :: ReadS [CertificateDescription]
readsPrec :: Int -> ReadS CertificateDescription
$creadsPrec :: Int -> ReadS CertificateDescription
Prelude.Read, Int -> CertificateDescription -> ShowS
[CertificateDescription] -> ShowS
CertificateDescription -> String
(Int -> CertificateDescription -> ShowS)
-> (CertificateDescription -> String)
-> ([CertificateDescription] -> ShowS)
-> Show CertificateDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CertificateDescription] -> ShowS
$cshowList :: [CertificateDescription] -> ShowS
show :: CertificateDescription -> String
$cshow :: CertificateDescription -> String
showsPrec :: Int -> CertificateDescription -> ShowS
$cshowsPrec :: Int -> CertificateDescription -> ShowS
Prelude.Show, (forall x. CertificateDescription -> Rep CertificateDescription x)
-> (forall x.
    Rep CertificateDescription x -> CertificateDescription)
-> Generic CertificateDescription
forall x. Rep CertificateDescription x -> CertificateDescription
forall x. CertificateDescription -> Rep CertificateDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CertificateDescription x -> CertificateDescription
$cfrom :: forall x. CertificateDescription -> Rep CertificateDescription x
Prelude.Generic)

-- |
-- Create a value of 'CertificateDescription' 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', 'certificateDescription_status' - The status of the certificate.
--
-- 'ownedBy', 'certificateDescription_ownedBy' - The ID of the Amazon Web Services account that owns the certificate.
--
-- 'lastModifiedDate', 'certificateDescription_lastModifiedDate' - The date and time the certificate was last modified.
--
-- 'caCertificateId', 'certificateDescription_caCertificateId' - The certificate ID of the CA certificate used to sign this certificate.
--
-- 'previousOwnedBy', 'certificateDescription_previousOwnedBy' - The ID of the Amazon Web Services account of the previous owner of the
-- certificate.
--
-- 'certificatePem', 'certificateDescription_certificatePem' - The certificate data, in PEM format.
--
-- 'certificateArn', 'certificateDescription_certificateArn' - The ARN of the certificate.
--
-- 'certificateId', 'certificateDescription_certificateId' - The ID of the certificate.
--
-- 'certificateMode', 'certificateDescription_certificateMode' - The mode of the certificate.
--
-- 'validity', 'certificateDescription_validity' - When the certificate is valid.
--
-- 'creationDate', 'certificateDescription_creationDate' - The date and time the certificate was created.
--
-- 'generationId', 'certificateDescription_generationId' - The generation ID of the certificate.
--
-- 'transferData', 'certificateDescription_transferData' - The transfer data.
--
-- 'customerVersion', 'certificateDescription_customerVersion' - The customer version of the certificate.
newCertificateDescription ::
  CertificateDescription
newCertificateDescription :: CertificateDescription
newCertificateDescription =
  CertificateDescription' :: Maybe CertificateStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CertificateMode
-> Maybe CertificateValidity
-> Maybe POSIX
-> Maybe Text
-> Maybe TransferData
-> Maybe Natural
-> CertificateDescription
CertificateDescription'
    { $sel:status:CertificateDescription' :: Maybe CertificateStatus
status = Maybe CertificateStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:ownedBy:CertificateDescription' :: Maybe Text
ownedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:CertificateDescription' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:caCertificateId:CertificateDescription' :: Maybe Text
caCertificateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:previousOwnedBy:CertificateDescription' :: Maybe Text
previousOwnedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificatePem:CertificateDescription' :: Maybe Text
certificatePem = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateArn:CertificateDescription' :: Maybe Text
certificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateId:CertificateDescription' :: Maybe Text
certificateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateMode:CertificateDescription' :: Maybe CertificateMode
certificateMode = Maybe CertificateMode
forall a. Maybe a
Prelude.Nothing,
      $sel:validity:CertificateDescription' :: Maybe CertificateValidity
validity = Maybe CertificateValidity
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:CertificateDescription' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:generationId:CertificateDescription' :: Maybe Text
generationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:transferData:CertificateDescription' :: Maybe TransferData
transferData = Maybe TransferData
forall a. Maybe a
Prelude.Nothing,
      $sel:customerVersion:CertificateDescription' :: Maybe Natural
customerVersion = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the certificate.
certificateDescription_status :: Lens.Lens' CertificateDescription (Prelude.Maybe CertificateStatus)
certificateDescription_status :: (Maybe CertificateStatus -> f (Maybe CertificateStatus))
-> CertificateDescription -> f CertificateDescription
certificateDescription_status = (CertificateDescription -> Maybe CertificateStatus)
-> (CertificateDescription
    -> Maybe CertificateStatus -> CertificateDescription)
-> Lens
     CertificateDescription
     CertificateDescription
     (Maybe CertificateStatus)
     (Maybe CertificateStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateDescription' {Maybe CertificateStatus
status :: Maybe CertificateStatus
$sel:status:CertificateDescription' :: CertificateDescription -> Maybe CertificateStatus
status} -> Maybe CertificateStatus
status) (\s :: CertificateDescription
s@CertificateDescription' {} Maybe CertificateStatus
a -> CertificateDescription
s {$sel:status:CertificateDescription' :: Maybe CertificateStatus
status = Maybe CertificateStatus
a} :: CertificateDescription)

-- | The ID of the Amazon Web Services account that owns the certificate.
certificateDescription_ownedBy :: Lens.Lens' CertificateDescription (Prelude.Maybe Prelude.Text)
certificateDescription_ownedBy :: (Maybe Text -> f (Maybe Text))
-> CertificateDescription -> f CertificateDescription
certificateDescription_ownedBy = (CertificateDescription -> Maybe Text)
-> (CertificateDescription -> Maybe Text -> CertificateDescription)
-> Lens
     CertificateDescription
     CertificateDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateDescription' {Maybe Text
ownedBy :: Maybe Text
$sel:ownedBy:CertificateDescription' :: CertificateDescription -> Maybe Text
ownedBy} -> Maybe Text
ownedBy) (\s :: CertificateDescription
s@CertificateDescription' {} Maybe Text
a -> CertificateDescription
s {$sel:ownedBy:CertificateDescription' :: Maybe Text
ownedBy = Maybe Text
a} :: CertificateDescription)

-- | The date and time the certificate was last modified.
certificateDescription_lastModifiedDate :: Lens.Lens' CertificateDescription (Prelude.Maybe Prelude.UTCTime)
certificateDescription_lastModifiedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CertificateDescription -> f CertificateDescription
certificateDescription_lastModifiedDate = (CertificateDescription -> Maybe POSIX)
-> (CertificateDescription
    -> Maybe POSIX -> CertificateDescription)
-> Lens
     CertificateDescription
     CertificateDescription
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateDescription' {Maybe POSIX
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:CertificateDescription' :: CertificateDescription -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: CertificateDescription
s@CertificateDescription' {} Maybe POSIX
a -> CertificateDescription
s {$sel:lastModifiedDate:CertificateDescription' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
a} :: CertificateDescription) ((Maybe POSIX -> f (Maybe POSIX))
 -> CertificateDescription -> f CertificateDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CertificateDescription
-> f CertificateDescription
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 certificate ID of the CA certificate used to sign this certificate.
certificateDescription_caCertificateId :: Lens.Lens' CertificateDescription (Prelude.Maybe Prelude.Text)
certificateDescription_caCertificateId :: (Maybe Text -> f (Maybe Text))
-> CertificateDescription -> f CertificateDescription
certificateDescription_caCertificateId = (CertificateDescription -> Maybe Text)
-> (CertificateDescription -> Maybe Text -> CertificateDescription)
-> Lens
     CertificateDescription
     CertificateDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateDescription' {Maybe Text
caCertificateId :: Maybe Text
$sel:caCertificateId:CertificateDescription' :: CertificateDescription -> Maybe Text
caCertificateId} -> Maybe Text
caCertificateId) (\s :: CertificateDescription
s@CertificateDescription' {} Maybe Text
a -> CertificateDescription
s {$sel:caCertificateId:CertificateDescription' :: Maybe Text
caCertificateId = Maybe Text
a} :: CertificateDescription)

-- | The ID of the Amazon Web Services account of the previous owner of the
-- certificate.
certificateDescription_previousOwnedBy :: Lens.Lens' CertificateDescription (Prelude.Maybe Prelude.Text)
certificateDescription_previousOwnedBy :: (Maybe Text -> f (Maybe Text))
-> CertificateDescription -> f CertificateDescription
certificateDescription_previousOwnedBy = (CertificateDescription -> Maybe Text)
-> (CertificateDescription -> Maybe Text -> CertificateDescription)
-> Lens
     CertificateDescription
     CertificateDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateDescription' {Maybe Text
previousOwnedBy :: Maybe Text
$sel:previousOwnedBy:CertificateDescription' :: CertificateDescription -> Maybe Text
previousOwnedBy} -> Maybe Text
previousOwnedBy) (\s :: CertificateDescription
s@CertificateDescription' {} Maybe Text
a -> CertificateDescription
s {$sel:previousOwnedBy:CertificateDescription' :: Maybe Text
previousOwnedBy = Maybe Text
a} :: CertificateDescription)

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

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

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

-- | The mode of the certificate.
certificateDescription_certificateMode :: Lens.Lens' CertificateDescription (Prelude.Maybe CertificateMode)
certificateDescription_certificateMode :: (Maybe CertificateMode -> f (Maybe CertificateMode))
-> CertificateDescription -> f CertificateDescription
certificateDescription_certificateMode = (CertificateDescription -> Maybe CertificateMode)
-> (CertificateDescription
    -> Maybe CertificateMode -> CertificateDescription)
-> Lens
     CertificateDescription
     CertificateDescription
     (Maybe CertificateMode)
     (Maybe CertificateMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateDescription' {Maybe CertificateMode
certificateMode :: Maybe CertificateMode
$sel:certificateMode:CertificateDescription' :: CertificateDescription -> Maybe CertificateMode
certificateMode} -> Maybe CertificateMode
certificateMode) (\s :: CertificateDescription
s@CertificateDescription' {} Maybe CertificateMode
a -> CertificateDescription
s {$sel:certificateMode:CertificateDescription' :: Maybe CertificateMode
certificateMode = Maybe CertificateMode
a} :: CertificateDescription)

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

-- | The date and time the certificate was created.
certificateDescription_creationDate :: Lens.Lens' CertificateDescription (Prelude.Maybe Prelude.UTCTime)
certificateDescription_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CertificateDescription -> f CertificateDescription
certificateDescription_creationDate = (CertificateDescription -> Maybe POSIX)
-> (CertificateDescription
    -> Maybe POSIX -> CertificateDescription)
-> Lens
     CertificateDescription
     CertificateDescription
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateDescription' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:CertificateDescription' :: CertificateDescription -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: CertificateDescription
s@CertificateDescription' {} Maybe POSIX
a -> CertificateDescription
s {$sel:creationDate:CertificateDescription' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: CertificateDescription) ((Maybe POSIX -> f (Maybe POSIX))
 -> CertificateDescription -> f CertificateDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CertificateDescription
-> f CertificateDescription
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 certificate.
certificateDescription_generationId :: Lens.Lens' CertificateDescription (Prelude.Maybe Prelude.Text)
certificateDescription_generationId :: (Maybe Text -> f (Maybe Text))
-> CertificateDescription -> f CertificateDescription
certificateDescription_generationId = (CertificateDescription -> Maybe Text)
-> (CertificateDescription -> Maybe Text -> CertificateDescription)
-> Lens
     CertificateDescription
     CertificateDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateDescription' {Maybe Text
generationId :: Maybe Text
$sel:generationId:CertificateDescription' :: CertificateDescription -> Maybe Text
generationId} -> Maybe Text
generationId) (\s :: CertificateDescription
s@CertificateDescription' {} Maybe Text
a -> CertificateDescription
s {$sel:generationId:CertificateDescription' :: Maybe Text
generationId = Maybe Text
a} :: CertificateDescription)

-- | The transfer data.
certificateDescription_transferData :: Lens.Lens' CertificateDescription (Prelude.Maybe TransferData)
certificateDescription_transferData :: (Maybe TransferData -> f (Maybe TransferData))
-> CertificateDescription -> f CertificateDescription
certificateDescription_transferData = (CertificateDescription -> Maybe TransferData)
-> (CertificateDescription
    -> Maybe TransferData -> CertificateDescription)
-> Lens
     CertificateDescription
     CertificateDescription
     (Maybe TransferData)
     (Maybe TransferData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateDescription' {Maybe TransferData
transferData :: Maybe TransferData
$sel:transferData:CertificateDescription' :: CertificateDescription -> Maybe TransferData
transferData} -> Maybe TransferData
transferData) (\s :: CertificateDescription
s@CertificateDescription' {} Maybe TransferData
a -> CertificateDescription
s {$sel:transferData:CertificateDescription' :: Maybe TransferData
transferData = Maybe TransferData
a} :: CertificateDescription)

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

instance Core.FromJSON CertificateDescription where
  parseJSON :: Value -> Parser CertificateDescription
parseJSON =
    String
-> (Object -> Parser CertificateDescription)
-> Value
-> Parser CertificateDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CertificateDescription"
      ( \Object
x ->
          Maybe CertificateStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CertificateMode
-> Maybe CertificateValidity
-> Maybe POSIX
-> Maybe Text
-> Maybe TransferData
-> Maybe Natural
-> CertificateDescription
CertificateDescription'
            (Maybe CertificateStatus
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe CertificateMode
 -> Maybe CertificateValidity
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe TransferData
 -> Maybe Natural
 -> CertificateDescription)
-> Parser (Maybe CertificateStatus)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CertificateMode
      -> Maybe CertificateValidity
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe TransferData
      -> Maybe Natural
      -> CertificateDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CertificateStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CertificateMode
   -> Maybe CertificateValidity
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe TransferData
   -> Maybe Natural
   -> CertificateDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CertificateMode
      -> Maybe CertificateValidity
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe TransferData
      -> Maybe Natural
      -> CertificateDescription)
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 Text
   -> Maybe Text
   -> Maybe CertificateMode
   -> Maybe CertificateValidity
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe TransferData
   -> Maybe Natural
   -> CertificateDescription)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CertificateMode
      -> Maybe CertificateValidity
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe TransferData
      -> Maybe Natural
      -> CertificateDescription)
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 Text
   -> Maybe Text
   -> Maybe CertificateMode
   -> Maybe CertificateValidity
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe TransferData
   -> Maybe Natural
   -> CertificateDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CertificateMode
      -> Maybe CertificateValidity
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe TransferData
      -> Maybe Natural
      -> CertificateDescription)
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
"caCertificateId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CertificateMode
   -> Maybe CertificateValidity
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe TransferData
   -> Maybe Natural
   -> CertificateDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CertificateMode
      -> Maybe CertificateValidity
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe TransferData
      -> Maybe Natural
      -> CertificateDescription)
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
"previousOwnedBy")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CertificateMode
   -> Maybe CertificateValidity
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe TransferData
   -> Maybe Natural
   -> CertificateDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe CertificateMode
      -> Maybe CertificateValidity
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe TransferData
      -> Maybe Natural
      -> CertificateDescription)
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 CertificateMode
   -> Maybe CertificateValidity
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe TransferData
   -> Maybe Natural
   -> CertificateDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe CertificateMode
      -> Maybe CertificateValidity
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe TransferData
      -> Maybe Natural
      -> CertificateDescription)
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 CertificateMode
   -> Maybe CertificateValidity
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe TransferData
   -> Maybe Natural
   -> CertificateDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe CertificateMode
      -> Maybe CertificateValidity
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe TransferData
      -> Maybe Natural
      -> CertificateDescription)
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 CertificateMode
   -> Maybe CertificateValidity
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe TransferData
   -> Maybe Natural
   -> CertificateDescription)
-> Parser (Maybe CertificateMode)
-> Parser
     (Maybe CertificateValidity
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe TransferData
      -> Maybe Natural
      -> CertificateDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CertificateMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"certificateMode")
            Parser
  (Maybe CertificateValidity
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe TransferData
   -> Maybe Natural
   -> CertificateDescription)
-> Parser (Maybe CertificateValidity)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe TransferData
      -> Maybe Natural
      -> CertificateDescription)
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 POSIX
   -> Maybe Text
   -> Maybe TransferData
   -> Maybe Natural
   -> CertificateDescription)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe TransferData -> Maybe Natural -> CertificateDescription)
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 TransferData -> Maybe Natural -> CertificateDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe TransferData -> Maybe Natural -> CertificateDescription)
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 TransferData -> Maybe Natural -> CertificateDescription)
-> Parser (Maybe TransferData)
-> Parser (Maybe Natural -> CertificateDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TransferData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"transferData")
            Parser (Maybe Natural -> CertificateDescription)
-> Parser (Maybe Natural) -> Parser CertificateDescription
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 CertificateDescription

instance Prelude.NFData CertificateDescription