{-# 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.Transfer.Types.DescribedCertificate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Transfer.Types.DescribedCertificate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Transfer.Types.CertificateStatusType
import Amazonka.Transfer.Types.CertificateType
import Amazonka.Transfer.Types.CertificateUsageType
import Amazonka.Transfer.Types.Tag

-- | Describes the properties of a certificate.
--
-- /See:/ 'newDescribedCertificate' smart constructor.
data DescribedCertificate = DescribedCertificate'
  { -- | An optional date that specifies when the certificate becomes active.
    DescribedCertificate -> Maybe POSIX
activeDate :: Prelude.Maybe Data.POSIX,
    -- | The file name for the certificate.
    DescribedCertificate -> Maybe (Sensitive Text)
certificate :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The list of certificates that make up the chain for the certificate.
    DescribedCertificate -> Maybe (Sensitive Text)
certificateChain :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | An array of identifiers for the imported certificates. You use this
    -- identifier for working with profiles and partner profiles.
    DescribedCertificate -> Maybe Text
certificateId :: Prelude.Maybe Prelude.Text,
    -- | The name or description that\'s used to identity the certificate.
    DescribedCertificate -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | An optional date that specifies when the certificate becomes inactive.
    DescribedCertificate -> Maybe POSIX
inactiveDate :: Prelude.Maybe Data.POSIX,
    -- | The final date that the certificate is valid.
    DescribedCertificate -> Maybe POSIX
notAfterDate :: Prelude.Maybe Data.POSIX,
    -- | The earliest date that the certificate is valid.
    DescribedCertificate -> Maybe POSIX
notBeforeDate :: Prelude.Maybe Data.POSIX,
    -- | The serial number for the certificate.
    DescribedCertificate -> Maybe Text
serial :: Prelude.Maybe Prelude.Text,
    -- | The certificate can be either @ACTIVE@, @PENDING_ROTATION@, or
    -- @INACTIVE@. @PENDING_ROTATION@ means that this certificate will replace
    -- the current certificate when it expires.
    DescribedCertificate -> Maybe CertificateStatusType
status :: Prelude.Maybe CertificateStatusType,
    -- | Key-value pairs that can be used to group and search for certificates.
    DescribedCertificate -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | If a private key has been specified for the certificate, its type is
    -- @CERTIFICATE_WITH_PRIVATE_KEY@. If there is no private key, the type is
    -- @CERTIFICATE@.
    DescribedCertificate -> Maybe CertificateType
type' :: Prelude.Maybe CertificateType,
    -- | Specifies whether this certificate is used for signing or encryption.
    DescribedCertificate -> Maybe CertificateUsageType
usage :: Prelude.Maybe CertificateUsageType,
    -- | The unique Amazon Resource Name (ARN) for the certificate.
    DescribedCertificate -> Text
arn :: Prelude.Text
  }
  deriving (DescribedCertificate -> DescribedCertificate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribedCertificate -> DescribedCertificate -> Bool
$c/= :: DescribedCertificate -> DescribedCertificate -> Bool
== :: DescribedCertificate -> DescribedCertificate -> Bool
$c== :: DescribedCertificate -> DescribedCertificate -> Bool
Prelude.Eq, Int -> DescribedCertificate -> ShowS
[DescribedCertificate] -> ShowS
DescribedCertificate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribedCertificate] -> ShowS
$cshowList :: [DescribedCertificate] -> ShowS
show :: DescribedCertificate -> String
$cshow :: DescribedCertificate -> String
showsPrec :: Int -> DescribedCertificate -> ShowS
$cshowsPrec :: Int -> DescribedCertificate -> ShowS
Prelude.Show, forall x. Rep DescribedCertificate x -> DescribedCertificate
forall x. DescribedCertificate -> Rep DescribedCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribedCertificate x -> DescribedCertificate
$cfrom :: forall x. DescribedCertificate -> Rep DescribedCertificate x
Prelude.Generic)

-- |
-- Create a value of 'DescribedCertificate' 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:
--
-- 'activeDate', 'describedCertificate_activeDate' - An optional date that specifies when the certificate becomes active.
--
-- 'certificate', 'describedCertificate_certificate' - The file name for the certificate.
--
-- 'certificateChain', 'describedCertificate_certificateChain' - The list of certificates that make up the chain for the certificate.
--
-- 'certificateId', 'describedCertificate_certificateId' - An array of identifiers for the imported certificates. You use this
-- identifier for working with profiles and partner profiles.
--
-- 'description', 'describedCertificate_description' - The name or description that\'s used to identity the certificate.
--
-- 'inactiveDate', 'describedCertificate_inactiveDate' - An optional date that specifies when the certificate becomes inactive.
--
-- 'notAfterDate', 'describedCertificate_notAfterDate' - The final date that the certificate is valid.
--
-- 'notBeforeDate', 'describedCertificate_notBeforeDate' - The earliest date that the certificate is valid.
--
-- 'serial', 'describedCertificate_serial' - The serial number for the certificate.
--
-- 'status', 'describedCertificate_status' - The certificate can be either @ACTIVE@, @PENDING_ROTATION@, or
-- @INACTIVE@. @PENDING_ROTATION@ means that this certificate will replace
-- the current certificate when it expires.
--
-- 'tags', 'describedCertificate_tags' - Key-value pairs that can be used to group and search for certificates.
--
-- 'type'', 'describedCertificate_type' - If a private key has been specified for the certificate, its type is
-- @CERTIFICATE_WITH_PRIVATE_KEY@. If there is no private key, the type is
-- @CERTIFICATE@.
--
-- 'usage', 'describedCertificate_usage' - Specifies whether this certificate is used for signing or encryption.
--
-- 'arn', 'describedCertificate_arn' - The unique Amazon Resource Name (ARN) for the certificate.
newDescribedCertificate ::
  -- | 'arn'
  Prelude.Text ->
  DescribedCertificate
newDescribedCertificate :: Text -> DescribedCertificate
newDescribedCertificate Text
pArn_ =
  DescribedCertificate'
    { $sel:activeDate:DescribedCertificate' :: Maybe POSIX
activeDate = forall a. Maybe a
Prelude.Nothing,
      $sel:certificate:DescribedCertificate' :: Maybe (Sensitive Text)
certificate = forall a. Maybe a
Prelude.Nothing,
      $sel:certificateChain:DescribedCertificate' :: Maybe (Sensitive Text)
certificateChain = forall a. Maybe a
Prelude.Nothing,
      $sel:certificateId:DescribedCertificate' :: Maybe Text
certificateId = forall a. Maybe a
Prelude.Nothing,
      $sel:description:DescribedCertificate' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:inactiveDate:DescribedCertificate' :: Maybe POSIX
inactiveDate = forall a. Maybe a
Prelude.Nothing,
      $sel:notAfterDate:DescribedCertificate' :: Maybe POSIX
notAfterDate = forall a. Maybe a
Prelude.Nothing,
      $sel:notBeforeDate:DescribedCertificate' :: Maybe POSIX
notBeforeDate = forall a. Maybe a
Prelude.Nothing,
      $sel:serial:DescribedCertificate' :: Maybe Text
serial = forall a. Maybe a
Prelude.Nothing,
      $sel:status:DescribedCertificate' :: Maybe CertificateStatusType
status = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:DescribedCertificate' :: Maybe (NonEmpty Tag)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:type':DescribedCertificate' :: Maybe CertificateType
type' = forall a. Maybe a
Prelude.Nothing,
      $sel:usage:DescribedCertificate' :: Maybe CertificateUsageType
usage = forall a. Maybe a
Prelude.Nothing,
      $sel:arn:DescribedCertificate' :: Text
arn = Text
pArn_
    }

-- | An optional date that specifies when the certificate becomes active.
describedCertificate_activeDate :: Lens.Lens' DescribedCertificate (Prelude.Maybe Prelude.UTCTime)
describedCertificate_activeDate :: Lens' DescribedCertificate (Maybe UTCTime)
describedCertificate_activeDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Maybe POSIX
activeDate :: Maybe POSIX
$sel:activeDate:DescribedCertificate' :: DescribedCertificate -> Maybe POSIX
activeDate} -> Maybe POSIX
activeDate) (\s :: DescribedCertificate
s@DescribedCertificate' {} Maybe POSIX
a -> DescribedCertificate
s {$sel:activeDate:DescribedCertificate' :: Maybe POSIX
activeDate = Maybe POSIX
a} :: DescribedCertificate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The file name for the certificate.
describedCertificate_certificate :: Lens.Lens' DescribedCertificate (Prelude.Maybe Prelude.Text)
describedCertificate_certificate :: Lens' DescribedCertificate (Maybe Text)
describedCertificate_certificate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Maybe (Sensitive Text)
certificate :: Maybe (Sensitive Text)
$sel:certificate:DescribedCertificate' :: DescribedCertificate -> Maybe (Sensitive Text)
certificate} -> Maybe (Sensitive Text)
certificate) (\s :: DescribedCertificate
s@DescribedCertificate' {} Maybe (Sensitive Text)
a -> DescribedCertificate
s {$sel:certificate:DescribedCertificate' :: Maybe (Sensitive Text)
certificate = Maybe (Sensitive Text)
a} :: DescribedCertificate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The list of certificates that make up the chain for the certificate.
describedCertificate_certificateChain :: Lens.Lens' DescribedCertificate (Prelude.Maybe Prelude.Text)
describedCertificate_certificateChain :: Lens' DescribedCertificate (Maybe Text)
describedCertificate_certificateChain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Maybe (Sensitive Text)
certificateChain :: Maybe (Sensitive Text)
$sel:certificateChain:DescribedCertificate' :: DescribedCertificate -> Maybe (Sensitive Text)
certificateChain} -> Maybe (Sensitive Text)
certificateChain) (\s :: DescribedCertificate
s@DescribedCertificate' {} Maybe (Sensitive Text)
a -> DescribedCertificate
s {$sel:certificateChain:DescribedCertificate' :: Maybe (Sensitive Text)
certificateChain = Maybe (Sensitive Text)
a} :: DescribedCertificate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | An array of identifiers for the imported certificates. You use this
-- identifier for working with profiles and partner profiles.
describedCertificate_certificateId :: Lens.Lens' DescribedCertificate (Prelude.Maybe Prelude.Text)
describedCertificate_certificateId :: Lens' DescribedCertificate (Maybe Text)
describedCertificate_certificateId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Maybe Text
certificateId :: Maybe Text
$sel:certificateId:DescribedCertificate' :: DescribedCertificate -> Maybe Text
certificateId} -> Maybe Text
certificateId) (\s :: DescribedCertificate
s@DescribedCertificate' {} Maybe Text
a -> DescribedCertificate
s {$sel:certificateId:DescribedCertificate' :: Maybe Text
certificateId = Maybe Text
a} :: DescribedCertificate)

-- | The name or description that\'s used to identity the certificate.
describedCertificate_description :: Lens.Lens' DescribedCertificate (Prelude.Maybe Prelude.Text)
describedCertificate_description :: Lens' DescribedCertificate (Maybe Text)
describedCertificate_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Maybe Text
description :: Maybe Text
$sel:description:DescribedCertificate' :: DescribedCertificate -> Maybe Text
description} -> Maybe Text
description) (\s :: DescribedCertificate
s@DescribedCertificate' {} Maybe Text
a -> DescribedCertificate
s {$sel:description:DescribedCertificate' :: Maybe Text
description = Maybe Text
a} :: DescribedCertificate)

-- | An optional date that specifies when the certificate becomes inactive.
describedCertificate_inactiveDate :: Lens.Lens' DescribedCertificate (Prelude.Maybe Prelude.UTCTime)
describedCertificate_inactiveDate :: Lens' DescribedCertificate (Maybe UTCTime)
describedCertificate_inactiveDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Maybe POSIX
inactiveDate :: Maybe POSIX
$sel:inactiveDate:DescribedCertificate' :: DescribedCertificate -> Maybe POSIX
inactiveDate} -> Maybe POSIX
inactiveDate) (\s :: DescribedCertificate
s@DescribedCertificate' {} Maybe POSIX
a -> DescribedCertificate
s {$sel:inactiveDate:DescribedCertificate' :: Maybe POSIX
inactiveDate = Maybe POSIX
a} :: DescribedCertificate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The final date that the certificate is valid.
describedCertificate_notAfterDate :: Lens.Lens' DescribedCertificate (Prelude.Maybe Prelude.UTCTime)
describedCertificate_notAfterDate :: Lens' DescribedCertificate (Maybe UTCTime)
describedCertificate_notAfterDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Maybe POSIX
notAfterDate :: Maybe POSIX
$sel:notAfterDate:DescribedCertificate' :: DescribedCertificate -> Maybe POSIX
notAfterDate} -> Maybe POSIX
notAfterDate) (\s :: DescribedCertificate
s@DescribedCertificate' {} Maybe POSIX
a -> DescribedCertificate
s {$sel:notAfterDate:DescribedCertificate' :: Maybe POSIX
notAfterDate = Maybe POSIX
a} :: DescribedCertificate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The earliest date that the certificate is valid.
describedCertificate_notBeforeDate :: Lens.Lens' DescribedCertificate (Prelude.Maybe Prelude.UTCTime)
describedCertificate_notBeforeDate :: Lens' DescribedCertificate (Maybe UTCTime)
describedCertificate_notBeforeDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Maybe POSIX
notBeforeDate :: Maybe POSIX
$sel:notBeforeDate:DescribedCertificate' :: DescribedCertificate -> Maybe POSIX
notBeforeDate} -> Maybe POSIX
notBeforeDate) (\s :: DescribedCertificate
s@DescribedCertificate' {} Maybe POSIX
a -> DescribedCertificate
s {$sel:notBeforeDate:DescribedCertificate' :: Maybe POSIX
notBeforeDate = Maybe POSIX
a} :: DescribedCertificate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The serial number for the certificate.
describedCertificate_serial :: Lens.Lens' DescribedCertificate (Prelude.Maybe Prelude.Text)
describedCertificate_serial :: Lens' DescribedCertificate (Maybe Text)
describedCertificate_serial = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Maybe Text
serial :: Maybe Text
$sel:serial:DescribedCertificate' :: DescribedCertificate -> Maybe Text
serial} -> Maybe Text
serial) (\s :: DescribedCertificate
s@DescribedCertificate' {} Maybe Text
a -> DescribedCertificate
s {$sel:serial:DescribedCertificate' :: Maybe Text
serial = Maybe Text
a} :: DescribedCertificate)

-- | The certificate can be either @ACTIVE@, @PENDING_ROTATION@, or
-- @INACTIVE@. @PENDING_ROTATION@ means that this certificate will replace
-- the current certificate when it expires.
describedCertificate_status :: Lens.Lens' DescribedCertificate (Prelude.Maybe CertificateStatusType)
describedCertificate_status :: Lens' DescribedCertificate (Maybe CertificateStatusType)
describedCertificate_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Maybe CertificateStatusType
status :: Maybe CertificateStatusType
$sel:status:DescribedCertificate' :: DescribedCertificate -> Maybe CertificateStatusType
status} -> Maybe CertificateStatusType
status) (\s :: DescribedCertificate
s@DescribedCertificate' {} Maybe CertificateStatusType
a -> DescribedCertificate
s {$sel:status:DescribedCertificate' :: Maybe CertificateStatusType
status = Maybe CertificateStatusType
a} :: DescribedCertificate)

-- | Key-value pairs that can be used to group and search for certificates.
describedCertificate_tags :: Lens.Lens' DescribedCertificate (Prelude.Maybe (Prelude.NonEmpty Tag))
describedCertificate_tags :: Lens' DescribedCertificate (Maybe (NonEmpty Tag))
describedCertificate_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:DescribedCertificate' :: DescribedCertificate -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: DescribedCertificate
s@DescribedCertificate' {} Maybe (NonEmpty Tag)
a -> DescribedCertificate
s {$sel:tags:DescribedCertificate' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: DescribedCertificate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If a private key has been specified for the certificate, its type is
-- @CERTIFICATE_WITH_PRIVATE_KEY@. If there is no private key, the type is
-- @CERTIFICATE@.
describedCertificate_type :: Lens.Lens' DescribedCertificate (Prelude.Maybe CertificateType)
describedCertificate_type :: Lens' DescribedCertificate (Maybe CertificateType)
describedCertificate_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Maybe CertificateType
type' :: Maybe CertificateType
$sel:type':DescribedCertificate' :: DescribedCertificate -> Maybe CertificateType
type'} -> Maybe CertificateType
type') (\s :: DescribedCertificate
s@DescribedCertificate' {} Maybe CertificateType
a -> DescribedCertificate
s {$sel:type':DescribedCertificate' :: Maybe CertificateType
type' = Maybe CertificateType
a} :: DescribedCertificate)

-- | Specifies whether this certificate is used for signing or encryption.
describedCertificate_usage :: Lens.Lens' DescribedCertificate (Prelude.Maybe CertificateUsageType)
describedCertificate_usage :: Lens' DescribedCertificate (Maybe CertificateUsageType)
describedCertificate_usage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Maybe CertificateUsageType
usage :: Maybe CertificateUsageType
$sel:usage:DescribedCertificate' :: DescribedCertificate -> Maybe CertificateUsageType
usage} -> Maybe CertificateUsageType
usage) (\s :: DescribedCertificate
s@DescribedCertificate' {} Maybe CertificateUsageType
a -> DescribedCertificate
s {$sel:usage:DescribedCertificate' :: Maybe CertificateUsageType
usage = Maybe CertificateUsageType
a} :: DescribedCertificate)

-- | The unique Amazon Resource Name (ARN) for the certificate.
describedCertificate_arn :: Lens.Lens' DescribedCertificate Prelude.Text
describedCertificate_arn :: Lens' DescribedCertificate Text
describedCertificate_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedCertificate' {Text
arn :: Text
$sel:arn:DescribedCertificate' :: DescribedCertificate -> Text
arn} -> Text
arn) (\s :: DescribedCertificate
s@DescribedCertificate' {} Text
a -> DescribedCertificate
s {$sel:arn:DescribedCertificate' :: Text
arn = Text
a} :: DescribedCertificate)

instance Data.FromJSON DescribedCertificate where
  parseJSON :: Value -> Parser DescribedCertificate
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DescribedCertificate"
      ( \Object
x ->
          Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe CertificateStatusType
-> Maybe (NonEmpty Tag)
-> Maybe CertificateType
-> Maybe CertificateUsageType
-> Text
-> DescribedCertificate
DescribedCertificate'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ActiveDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Certificate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CertificateChain")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CertificateId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"InactiveDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NotAfterDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NotBeforeDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Serial")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Tags")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Type")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Usage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Arn")
      )

instance Prelude.Hashable DescribedCertificate where
  hashWithSalt :: Int -> DescribedCertificate -> Int
hashWithSalt Int
_salt DescribedCertificate' {Maybe (NonEmpty Tag)
Maybe Text
Maybe (Sensitive Text)
Maybe POSIX
Maybe CertificateStatusType
Maybe CertificateType
Maybe CertificateUsageType
Text
arn :: Text
usage :: Maybe CertificateUsageType
type' :: Maybe CertificateType
tags :: Maybe (NonEmpty Tag)
status :: Maybe CertificateStatusType
serial :: Maybe Text
notBeforeDate :: Maybe POSIX
notAfterDate :: Maybe POSIX
inactiveDate :: Maybe POSIX
description :: Maybe Text
certificateId :: Maybe Text
certificateChain :: Maybe (Sensitive Text)
certificate :: Maybe (Sensitive Text)
activeDate :: Maybe POSIX
$sel:arn:DescribedCertificate' :: DescribedCertificate -> Text
$sel:usage:DescribedCertificate' :: DescribedCertificate -> Maybe CertificateUsageType
$sel:type':DescribedCertificate' :: DescribedCertificate -> Maybe CertificateType
$sel:tags:DescribedCertificate' :: DescribedCertificate -> Maybe (NonEmpty Tag)
$sel:status:DescribedCertificate' :: DescribedCertificate -> Maybe CertificateStatusType
$sel:serial:DescribedCertificate' :: DescribedCertificate -> Maybe Text
$sel:notBeforeDate:DescribedCertificate' :: DescribedCertificate -> Maybe POSIX
$sel:notAfterDate:DescribedCertificate' :: DescribedCertificate -> Maybe POSIX
$sel:inactiveDate:DescribedCertificate' :: DescribedCertificate -> Maybe POSIX
$sel:description:DescribedCertificate' :: DescribedCertificate -> Maybe Text
$sel:certificateId:DescribedCertificate' :: DescribedCertificate -> Maybe Text
$sel:certificateChain:DescribedCertificate' :: DescribedCertificate -> Maybe (Sensitive Text)
$sel:certificate:DescribedCertificate' :: DescribedCertificate -> Maybe (Sensitive Text)
$sel:activeDate:DescribedCertificate' :: DescribedCertificate -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
activeDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
certificate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
certificateChain
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
certificateId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
inactiveDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
notAfterDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
notBeforeDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serial
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CertificateStatusType
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Tag)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CertificateType
type'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CertificateUsageType
usage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn

instance Prelude.NFData DescribedCertificate where
  rnf :: DescribedCertificate -> ()
rnf DescribedCertificate' {Maybe (NonEmpty Tag)
Maybe Text
Maybe (Sensitive Text)
Maybe POSIX
Maybe CertificateStatusType
Maybe CertificateType
Maybe CertificateUsageType
Text
arn :: Text
usage :: Maybe CertificateUsageType
type' :: Maybe CertificateType
tags :: Maybe (NonEmpty Tag)
status :: Maybe CertificateStatusType
serial :: Maybe Text
notBeforeDate :: Maybe POSIX
notAfterDate :: Maybe POSIX
inactiveDate :: Maybe POSIX
description :: Maybe Text
certificateId :: Maybe Text
certificateChain :: Maybe (Sensitive Text)
certificate :: Maybe (Sensitive Text)
activeDate :: Maybe POSIX
$sel:arn:DescribedCertificate' :: DescribedCertificate -> Text
$sel:usage:DescribedCertificate' :: DescribedCertificate -> Maybe CertificateUsageType
$sel:type':DescribedCertificate' :: DescribedCertificate -> Maybe CertificateType
$sel:tags:DescribedCertificate' :: DescribedCertificate -> Maybe (NonEmpty Tag)
$sel:status:DescribedCertificate' :: DescribedCertificate -> Maybe CertificateStatusType
$sel:serial:DescribedCertificate' :: DescribedCertificate -> Maybe Text
$sel:notBeforeDate:DescribedCertificate' :: DescribedCertificate -> Maybe POSIX
$sel:notAfterDate:DescribedCertificate' :: DescribedCertificate -> Maybe POSIX
$sel:inactiveDate:DescribedCertificate' :: DescribedCertificate -> Maybe POSIX
$sel:description:DescribedCertificate' :: DescribedCertificate -> Maybe Text
$sel:certificateId:DescribedCertificate' :: DescribedCertificate -> Maybe Text
$sel:certificateChain:DescribedCertificate' :: DescribedCertificate -> Maybe (Sensitive Text)
$sel:certificate:DescribedCertificate' :: DescribedCertificate -> Maybe (Sensitive Text)
$sel:activeDate:DescribedCertificate' :: DescribedCertificate -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
activeDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
certificate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
certificateChain
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificateId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
inactiveDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
notAfterDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
notBeforeDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serial
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CertificateStatusType
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Tag)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CertificateType
type'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CertificateUsageType
usage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn