{-# 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.Lightsail.Types.Certificate
-- 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.Lightsail.Types.Certificate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.CertificateStatus
import Amazonka.Lightsail.Types.DomainValidationRecord
import Amazonka.Lightsail.Types.RenewalSummary
import Amazonka.Lightsail.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | Describes the full details of an Amazon Lightsail SSL\/TLS certificate.
--
-- To get a summary of a certificate, use the @GetCertificates@ action and
-- ommit @includeCertificateDetails@ from your request. The response will
-- include only the certificate Amazon Resource Name (ARN), certificate
-- name, domain name, and tags.
--
-- /See:/ 'newCertificate' smart constructor.
data Certificate = Certificate'
  { -- | The validation status of the certificate.
    Certificate -> Maybe CertificateStatus
status :: Prelude.Maybe CertificateStatus,
    -- | An array of strings that specify the alternate domains (e.g.,
    -- @example2.com@) and subdomains (e.g., @blog.example.com@) of the
    -- certificate.
    Certificate -> Maybe [Text]
subjectAlternativeNames :: Prelude.Maybe [Prelude.Text],
    -- | The Amazon Resource Name (ARN) of the certificate.
    Certificate -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the certificate was created.
    Certificate -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The renewal eligibility of the certificate.
    Certificate -> Maybe Text
eligibleToRenew :: Prelude.Maybe Prelude.Text,
    -- | The validation failure reason, if any, of the certificate.
    --
    -- The following failure reasons are possible:
    --
    -- -   __@NO_AVAILABLE_CONTACTS@__ - This failure applies to email
    --     validation, which is not available for Lightsail certificates.
    --
    -- -   __@ADDITIONAL_VERIFICATION_REQUIRED@__ - Lightsail requires
    --     additional information to process this certificate request. This can
    --     happen as a fraud-protection measure, such as when the domain ranks
    --     within the Alexa top 1000 websites. To provide the required
    --     information, use the
    --     <https://console.aws.amazon.com/support/home AWS Support Center> to
    --     contact AWS Support.
    --
    --     You cannot request a certificate for Amazon-owned domain names such
    --     as those ending in amazonaws.com, cloudfront.net, or
    --     elasticbeanstalk.com.
    --
    -- -   __@DOMAIN_NOT_ALLOWED@__ - One or more of the domain names in the
    --     certificate request was reported as an unsafe domain by
    --     <https://www.virustotal.com/gui/home/url VirusTotal>. To correct the
    --     problem, search for your domain name on the
    --     <https://www.virustotal.com/gui/home/url VirusTotal> website. If
    --     your domain is reported as suspicious, see
    --     <https://developers.google.com/web/fundamentals/security/hacked Google Help for Hacked Websites>
    --     to learn what you can do.
    --
    --     If you believe that the result is a false positive, notify the
    --     organization that is reporting the domain. VirusTotal is an
    --     aggregate of several antivirus and URL scanners and cannot remove
    --     your domain from a block list itself. After you correct the problem
    --     and the VirusTotal registry has been updated, request a new
    --     certificate.
    --
    --     If you see this error and your domain is not included in the
    --     VirusTotal list, visit the
    --     <https://console.aws.amazon.com/support/home AWS Support Center> and
    --     create a case.
    --
    -- -   __@INVALID_PUBLIC_DOMAIN@__ - One or more of the domain names in the
    --     certificate request is not valid. Typically, this is because a
    --     domain name in the request is not a valid top-level domain. Try to
    --     request a certificate again, correcting any spelling errors or typos
    --     that were in the failed request, and ensure that all domain names in
    --     the request are for valid top-level domains. For example, you cannot
    --     request a certificate for @example.invalidpublicdomain@ because
    --     @invalidpublicdomain@ is not a valid top-level domain.
    --
    -- -   __@OTHER@__ - Typically, this failure occurs when there is a
    --     typographical error in one or more of the domain names in the
    --     certificate request. Try to request a certificate again, correcting
    --     any spelling errors or typos that were in the failed request.
    Certificate -> Maybe Text
requestFailureReason :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the certificate was revoked. This value is present
    -- only when the certificate status is @REVOKED@.
    Certificate -> Maybe POSIX
revokedAt :: Prelude.Maybe Core.POSIX,
    -- | The timestamp when the certificate is first valid.
    Certificate -> Maybe POSIX
notBefore :: Prelude.Maybe Core.POSIX,
    -- | The reason the certificate was revoked. This value is present only when
    -- the certificate status is @REVOKED@.
    Certificate -> Maybe Text
revocationReason :: Prelude.Maybe Prelude.Text,
    -- | The domain name of the certificate.
    Certificate -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    -- | The name of the certificate (e.g., @my-certificate@).
    Certificate -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | An object that describes the status of the certificate renewal managed
    -- by Lightsail.
    Certificate -> Maybe RenewalSummary
renewalSummary :: Prelude.Maybe RenewalSummary,
    -- | The support code. Include this code in your email to support when you
    -- have questions about your Lightsail certificate. This code enables our
    -- support team to look up your Lightsail information more easily.
    Certificate -> Maybe Text
supportCode :: Prelude.Maybe Prelude.Text,
    -- | An array of objects that describe the domain validation records of the
    -- certificate.
    Certificate -> Maybe [DomainValidationRecord]
domainValidationRecords :: Prelude.Maybe [DomainValidationRecord],
    -- | The number of Lightsail resources that the certificate is attached to.
    Certificate -> Maybe Int
inUseResourceCount :: Prelude.Maybe Prelude.Int,
    -- | The timestamp when the certificate was issued.
    Certificate -> Maybe POSIX
issuedAt :: Prelude.Maybe Core.POSIX,
    -- | The algorithm used to generate the key pair (the public and private key)
    -- of the certificate.
    Certificate -> Maybe Text
keyAlgorithm :: Prelude.Maybe Prelude.Text,
    -- | The serial number of the certificate.
    Certificate -> Maybe Text
serialNumber :: Prelude.Maybe Prelude.Text,
    -- | The certificate authority that issued the certificate.
    Certificate -> Maybe Text
issuerCA :: Prelude.Maybe Prelude.Text,
    -- | The tag keys and optional values for the resource. For more information
    -- about tags in Lightsail, see the
    -- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags Amazon Lightsail Developer Guide>.
    Certificate -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The timestamp when the certificate expires.
    Certificate -> Maybe POSIX
notAfter :: Prelude.Maybe Core.POSIX
  }
  deriving (Certificate -> Certificate -> Bool
(Certificate -> Certificate -> Bool)
-> (Certificate -> Certificate -> Bool) -> Eq Certificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Certificate -> Certificate -> Bool
$c/= :: Certificate -> Certificate -> Bool
== :: Certificate -> Certificate -> Bool
$c== :: Certificate -> Certificate -> Bool
Prelude.Eq, ReadPrec [Certificate]
ReadPrec Certificate
Int -> ReadS Certificate
ReadS [Certificate]
(Int -> ReadS Certificate)
-> ReadS [Certificate]
-> ReadPrec Certificate
-> ReadPrec [Certificate]
-> Read Certificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Certificate]
$creadListPrec :: ReadPrec [Certificate]
readPrec :: ReadPrec Certificate
$creadPrec :: ReadPrec Certificate
readList :: ReadS [Certificate]
$creadList :: ReadS [Certificate]
readsPrec :: Int -> ReadS Certificate
$creadsPrec :: Int -> ReadS Certificate
Prelude.Read, Int -> Certificate -> ShowS
[Certificate] -> ShowS
Certificate -> String
(Int -> Certificate -> ShowS)
-> (Certificate -> String)
-> ([Certificate] -> ShowS)
-> Show Certificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Certificate] -> ShowS
$cshowList :: [Certificate] -> ShowS
show :: Certificate -> String
$cshow :: Certificate -> String
showsPrec :: Int -> Certificate -> ShowS
$cshowsPrec :: Int -> Certificate -> ShowS
Prelude.Show, (forall x. Certificate -> Rep Certificate x)
-> (forall x. Rep Certificate x -> Certificate)
-> Generic Certificate
forall x. Rep Certificate x -> Certificate
forall x. Certificate -> Rep Certificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Certificate x -> Certificate
$cfrom :: forall x. Certificate -> Rep Certificate x
Prelude.Generic)

-- |
-- Create a value of 'Certificate' 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', 'certificate_status' - The validation status of the certificate.
--
-- 'subjectAlternativeNames', 'certificate_subjectAlternativeNames' - An array of strings that specify the alternate domains (e.g.,
-- @example2.com@) and subdomains (e.g., @blog.example.com@) of the
-- certificate.
--
-- 'arn', 'certificate_arn' - The Amazon Resource Name (ARN) of the certificate.
--
-- 'createdAt', 'certificate_createdAt' - The timestamp when the certificate was created.
--
-- 'eligibleToRenew', 'certificate_eligibleToRenew' - The renewal eligibility of the certificate.
--
-- 'requestFailureReason', 'certificate_requestFailureReason' - The validation failure reason, if any, of the certificate.
--
-- The following failure reasons are possible:
--
-- -   __@NO_AVAILABLE_CONTACTS@__ - This failure applies to email
--     validation, which is not available for Lightsail certificates.
--
-- -   __@ADDITIONAL_VERIFICATION_REQUIRED@__ - Lightsail requires
--     additional information to process this certificate request. This can
--     happen as a fraud-protection measure, such as when the domain ranks
--     within the Alexa top 1000 websites. To provide the required
--     information, use the
--     <https://console.aws.amazon.com/support/home AWS Support Center> to
--     contact AWS Support.
--
--     You cannot request a certificate for Amazon-owned domain names such
--     as those ending in amazonaws.com, cloudfront.net, or
--     elasticbeanstalk.com.
--
-- -   __@DOMAIN_NOT_ALLOWED@__ - One or more of the domain names in the
--     certificate request was reported as an unsafe domain by
--     <https://www.virustotal.com/gui/home/url VirusTotal>. To correct the
--     problem, search for your domain name on the
--     <https://www.virustotal.com/gui/home/url VirusTotal> website. If
--     your domain is reported as suspicious, see
--     <https://developers.google.com/web/fundamentals/security/hacked Google Help for Hacked Websites>
--     to learn what you can do.
--
--     If you believe that the result is a false positive, notify the
--     organization that is reporting the domain. VirusTotal is an
--     aggregate of several antivirus and URL scanners and cannot remove
--     your domain from a block list itself. After you correct the problem
--     and the VirusTotal registry has been updated, request a new
--     certificate.
--
--     If you see this error and your domain is not included in the
--     VirusTotal list, visit the
--     <https://console.aws.amazon.com/support/home AWS Support Center> and
--     create a case.
--
-- -   __@INVALID_PUBLIC_DOMAIN@__ - One or more of the domain names in the
--     certificate request is not valid. Typically, this is because a
--     domain name in the request is not a valid top-level domain. Try to
--     request a certificate again, correcting any spelling errors or typos
--     that were in the failed request, and ensure that all domain names in
--     the request are for valid top-level domains. For example, you cannot
--     request a certificate for @example.invalidpublicdomain@ because
--     @invalidpublicdomain@ is not a valid top-level domain.
--
-- -   __@OTHER@__ - Typically, this failure occurs when there is a
--     typographical error in one or more of the domain names in the
--     certificate request. Try to request a certificate again, correcting
--     any spelling errors or typos that were in the failed request.
--
-- 'revokedAt', 'certificate_revokedAt' - The timestamp when the certificate was revoked. This value is present
-- only when the certificate status is @REVOKED@.
--
-- 'notBefore', 'certificate_notBefore' - The timestamp when the certificate is first valid.
--
-- 'revocationReason', 'certificate_revocationReason' - The reason the certificate was revoked. This value is present only when
-- the certificate status is @REVOKED@.
--
-- 'domainName', 'certificate_domainName' - The domain name of the certificate.
--
-- 'name', 'certificate_name' - The name of the certificate (e.g., @my-certificate@).
--
-- 'renewalSummary', 'certificate_renewalSummary' - An object that describes the status of the certificate renewal managed
-- by Lightsail.
--
-- 'supportCode', 'certificate_supportCode' - The support code. Include this code in your email to support when you
-- have questions about your Lightsail certificate. This code enables our
-- support team to look up your Lightsail information more easily.
--
-- 'domainValidationRecords', 'certificate_domainValidationRecords' - An array of objects that describe the domain validation records of the
-- certificate.
--
-- 'inUseResourceCount', 'certificate_inUseResourceCount' - The number of Lightsail resources that the certificate is attached to.
--
-- 'issuedAt', 'certificate_issuedAt' - The timestamp when the certificate was issued.
--
-- 'keyAlgorithm', 'certificate_keyAlgorithm' - The algorithm used to generate the key pair (the public and private key)
-- of the certificate.
--
-- 'serialNumber', 'certificate_serialNumber' - The serial number of the certificate.
--
-- 'issuerCA', 'certificate_issuerCA' - The certificate authority that issued the certificate.
--
-- 'tags', 'certificate_tags' - The tag keys and optional values for the resource. For more information
-- about tags in Lightsail, see the
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags Amazon Lightsail Developer Guide>.
--
-- 'notAfter', 'certificate_notAfter' - The timestamp when the certificate expires.
newCertificate ::
  Certificate
newCertificate :: Certificate
newCertificate =
  Certificate' :: Maybe CertificateStatus
-> Maybe [Text]
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe RenewalSummary
-> Maybe Text
-> Maybe [DomainValidationRecord]
-> Maybe Int
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Maybe POSIX
-> Certificate
Certificate'
    { $sel:status:Certificate' :: Maybe CertificateStatus
status = Maybe CertificateStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:subjectAlternativeNames:Certificate' :: Maybe [Text]
subjectAlternativeNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Certificate' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:Certificate' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:eligibleToRenew:Certificate' :: Maybe Text
eligibleToRenew = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:requestFailureReason:Certificate' :: Maybe Text
requestFailureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:revokedAt:Certificate' :: Maybe POSIX
revokedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:notBefore:Certificate' :: Maybe POSIX
notBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:revocationReason:Certificate' :: Maybe Text
revocationReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:Certificate' :: Maybe Text
domainName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Certificate' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:renewalSummary:Certificate' :: Maybe RenewalSummary
renewalSummary = Maybe RenewalSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:supportCode:Certificate' :: Maybe Text
supportCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainValidationRecords:Certificate' :: Maybe [DomainValidationRecord]
domainValidationRecords = Maybe [DomainValidationRecord]
forall a. Maybe a
Prelude.Nothing,
      $sel:inUseResourceCount:Certificate' :: Maybe Int
inUseResourceCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:issuedAt:Certificate' :: Maybe POSIX
issuedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:keyAlgorithm:Certificate' :: Maybe Text
keyAlgorithm = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serialNumber:Certificate' :: Maybe Text
serialNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:issuerCA:Certificate' :: Maybe Text
issuerCA = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Certificate' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:notAfter:Certificate' :: Maybe POSIX
notAfter = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

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

-- | An array of strings that specify the alternate domains (e.g.,
-- @example2.com@) and subdomains (e.g., @blog.example.com@) of the
-- certificate.
certificate_subjectAlternativeNames :: Lens.Lens' Certificate (Prelude.Maybe [Prelude.Text])
certificate_subjectAlternativeNames :: (Maybe [Text] -> f (Maybe [Text])) -> Certificate -> f Certificate
certificate_subjectAlternativeNames = (Certificate -> Maybe [Text])
-> (Certificate -> Maybe [Text] -> Certificate)
-> Lens Certificate Certificate (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe [Text]
subjectAlternativeNames :: Maybe [Text]
$sel:subjectAlternativeNames:Certificate' :: Certificate -> Maybe [Text]
subjectAlternativeNames} -> Maybe [Text]
subjectAlternativeNames) (\s :: Certificate
s@Certificate' {} Maybe [Text]
a -> Certificate
s {$sel:subjectAlternativeNames:Certificate' :: Maybe [Text]
subjectAlternativeNames = Maybe [Text]
a} :: Certificate) ((Maybe [Text] -> f (Maybe [Text]))
 -> Certificate -> f Certificate)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Certificate
-> f Certificate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the certificate.
certificate_arn :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_arn :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_arn = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
arn :: Maybe Text
$sel:arn:Certificate' :: Certificate -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:arn:Certificate' :: Maybe Text
arn = Maybe Text
a} :: Certificate)

-- | The timestamp when the certificate was created.
certificate_createdAt :: Lens.Lens' Certificate (Prelude.Maybe Prelude.UTCTime)
certificate_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate -> f Certificate
certificate_createdAt = (Certificate -> Maybe POSIX)
-> (Certificate -> Maybe POSIX -> Certificate)
-> Lens Certificate Certificate (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Certificate' :: Certificate -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Certificate
s@Certificate' {} Maybe POSIX
a -> Certificate
s {$sel:createdAt:Certificate' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Certificate) ((Maybe POSIX -> f (Maybe POSIX)) -> Certificate -> f Certificate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate
-> f Certificate
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 renewal eligibility of the certificate.
certificate_eligibleToRenew :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_eligibleToRenew :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_eligibleToRenew = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
eligibleToRenew :: Maybe Text
$sel:eligibleToRenew:Certificate' :: Certificate -> Maybe Text
eligibleToRenew} -> Maybe Text
eligibleToRenew) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:eligibleToRenew:Certificate' :: Maybe Text
eligibleToRenew = Maybe Text
a} :: Certificate)

-- | The validation failure reason, if any, of the certificate.
--
-- The following failure reasons are possible:
--
-- -   __@NO_AVAILABLE_CONTACTS@__ - This failure applies to email
--     validation, which is not available for Lightsail certificates.
--
-- -   __@ADDITIONAL_VERIFICATION_REQUIRED@__ - Lightsail requires
--     additional information to process this certificate request. This can
--     happen as a fraud-protection measure, such as when the domain ranks
--     within the Alexa top 1000 websites. To provide the required
--     information, use the
--     <https://console.aws.amazon.com/support/home AWS Support Center> to
--     contact AWS Support.
--
--     You cannot request a certificate for Amazon-owned domain names such
--     as those ending in amazonaws.com, cloudfront.net, or
--     elasticbeanstalk.com.
--
-- -   __@DOMAIN_NOT_ALLOWED@__ - One or more of the domain names in the
--     certificate request was reported as an unsafe domain by
--     <https://www.virustotal.com/gui/home/url VirusTotal>. To correct the
--     problem, search for your domain name on the
--     <https://www.virustotal.com/gui/home/url VirusTotal> website. If
--     your domain is reported as suspicious, see
--     <https://developers.google.com/web/fundamentals/security/hacked Google Help for Hacked Websites>
--     to learn what you can do.
--
--     If you believe that the result is a false positive, notify the
--     organization that is reporting the domain. VirusTotal is an
--     aggregate of several antivirus and URL scanners and cannot remove
--     your domain from a block list itself. After you correct the problem
--     and the VirusTotal registry has been updated, request a new
--     certificate.
--
--     If you see this error and your domain is not included in the
--     VirusTotal list, visit the
--     <https://console.aws.amazon.com/support/home AWS Support Center> and
--     create a case.
--
-- -   __@INVALID_PUBLIC_DOMAIN@__ - One or more of the domain names in the
--     certificate request is not valid. Typically, this is because a
--     domain name in the request is not a valid top-level domain. Try to
--     request a certificate again, correcting any spelling errors or typos
--     that were in the failed request, and ensure that all domain names in
--     the request are for valid top-level domains. For example, you cannot
--     request a certificate for @example.invalidpublicdomain@ because
--     @invalidpublicdomain@ is not a valid top-level domain.
--
-- -   __@OTHER@__ - Typically, this failure occurs when there is a
--     typographical error in one or more of the domain names in the
--     certificate request. Try to request a certificate again, correcting
--     any spelling errors or typos that were in the failed request.
certificate_requestFailureReason :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_requestFailureReason :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_requestFailureReason = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
requestFailureReason :: Maybe Text
$sel:requestFailureReason:Certificate' :: Certificate -> Maybe Text
requestFailureReason} -> Maybe Text
requestFailureReason) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:requestFailureReason:Certificate' :: Maybe Text
requestFailureReason = Maybe Text
a} :: Certificate)

-- | The timestamp when the certificate was revoked. This value is present
-- only when the certificate status is @REVOKED@.
certificate_revokedAt :: Lens.Lens' Certificate (Prelude.Maybe Prelude.UTCTime)
certificate_revokedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate -> f Certificate
certificate_revokedAt = (Certificate -> Maybe POSIX)
-> (Certificate -> Maybe POSIX -> Certificate)
-> Lens Certificate Certificate (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe POSIX
revokedAt :: Maybe POSIX
$sel:revokedAt:Certificate' :: Certificate -> Maybe POSIX
revokedAt} -> Maybe POSIX
revokedAt) (\s :: Certificate
s@Certificate' {} Maybe POSIX
a -> Certificate
s {$sel:revokedAt:Certificate' :: Maybe POSIX
revokedAt = Maybe POSIX
a} :: Certificate) ((Maybe POSIX -> f (Maybe POSIX)) -> Certificate -> f Certificate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate
-> f Certificate
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 timestamp when the certificate is first valid.
certificate_notBefore :: Lens.Lens' Certificate (Prelude.Maybe Prelude.UTCTime)
certificate_notBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate -> f Certificate
certificate_notBefore = (Certificate -> Maybe POSIX)
-> (Certificate -> Maybe POSIX -> Certificate)
-> Lens Certificate Certificate (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe POSIX
notBefore :: Maybe POSIX
$sel:notBefore:Certificate' :: Certificate -> Maybe POSIX
notBefore} -> Maybe POSIX
notBefore) (\s :: Certificate
s@Certificate' {} Maybe POSIX
a -> Certificate
s {$sel:notBefore:Certificate' :: Maybe POSIX
notBefore = Maybe POSIX
a} :: Certificate) ((Maybe POSIX -> f (Maybe POSIX)) -> Certificate -> f Certificate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate
-> f Certificate
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 reason the certificate was revoked. This value is present only when
-- the certificate status is @REVOKED@.
certificate_revocationReason :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_revocationReason :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_revocationReason = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
revocationReason :: Maybe Text
$sel:revocationReason:Certificate' :: Certificate -> Maybe Text
revocationReason} -> Maybe Text
revocationReason) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:revocationReason:Certificate' :: Maybe Text
revocationReason = Maybe Text
a} :: Certificate)

-- | The domain name of the certificate.
certificate_domainName :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_domainName :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_domainName = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
domainName :: Maybe Text
$sel:domainName:Certificate' :: Certificate -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:domainName:Certificate' :: Maybe Text
domainName = Maybe Text
a} :: Certificate)

-- | The name of the certificate (e.g., @my-certificate@).
certificate_name :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_name :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_name = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
name :: Maybe Text
$sel:name:Certificate' :: Certificate -> Maybe Text
name} -> Maybe Text
name) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:name:Certificate' :: Maybe Text
name = Maybe Text
a} :: Certificate)

-- | An object that describes the status of the certificate renewal managed
-- by Lightsail.
certificate_renewalSummary :: Lens.Lens' Certificate (Prelude.Maybe RenewalSummary)
certificate_renewalSummary :: (Maybe RenewalSummary -> f (Maybe RenewalSummary))
-> Certificate -> f Certificate
certificate_renewalSummary = (Certificate -> Maybe RenewalSummary)
-> (Certificate -> Maybe RenewalSummary -> Certificate)
-> Lens
     Certificate
     Certificate
     (Maybe RenewalSummary)
     (Maybe RenewalSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe RenewalSummary
renewalSummary :: Maybe RenewalSummary
$sel:renewalSummary:Certificate' :: Certificate -> Maybe RenewalSummary
renewalSummary} -> Maybe RenewalSummary
renewalSummary) (\s :: Certificate
s@Certificate' {} Maybe RenewalSummary
a -> Certificate
s {$sel:renewalSummary:Certificate' :: Maybe RenewalSummary
renewalSummary = Maybe RenewalSummary
a} :: Certificate)

-- | The support code. Include this code in your email to support when you
-- have questions about your Lightsail certificate. This code enables our
-- support team to look up your Lightsail information more easily.
certificate_supportCode :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_supportCode :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_supportCode = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
supportCode :: Maybe Text
$sel:supportCode:Certificate' :: Certificate -> Maybe Text
supportCode} -> Maybe Text
supportCode) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:supportCode:Certificate' :: Maybe Text
supportCode = Maybe Text
a} :: Certificate)

-- | An array of objects that describe the domain validation records of the
-- certificate.
certificate_domainValidationRecords :: Lens.Lens' Certificate (Prelude.Maybe [DomainValidationRecord])
certificate_domainValidationRecords :: (Maybe [DomainValidationRecord]
 -> f (Maybe [DomainValidationRecord]))
-> Certificate -> f Certificate
certificate_domainValidationRecords = (Certificate -> Maybe [DomainValidationRecord])
-> (Certificate -> Maybe [DomainValidationRecord] -> Certificate)
-> Lens
     Certificate
     Certificate
     (Maybe [DomainValidationRecord])
     (Maybe [DomainValidationRecord])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe [DomainValidationRecord]
domainValidationRecords :: Maybe [DomainValidationRecord]
$sel:domainValidationRecords:Certificate' :: Certificate -> Maybe [DomainValidationRecord]
domainValidationRecords} -> Maybe [DomainValidationRecord]
domainValidationRecords) (\s :: Certificate
s@Certificate' {} Maybe [DomainValidationRecord]
a -> Certificate
s {$sel:domainValidationRecords:Certificate' :: Maybe [DomainValidationRecord]
domainValidationRecords = Maybe [DomainValidationRecord]
a} :: Certificate) ((Maybe [DomainValidationRecord]
  -> f (Maybe [DomainValidationRecord]))
 -> Certificate -> f Certificate)
-> ((Maybe [DomainValidationRecord]
     -> f (Maybe [DomainValidationRecord]))
    -> Maybe [DomainValidationRecord]
    -> f (Maybe [DomainValidationRecord]))
-> (Maybe [DomainValidationRecord]
    -> f (Maybe [DomainValidationRecord]))
-> Certificate
-> f Certificate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DomainValidationRecord]
  [DomainValidationRecord]
  [DomainValidationRecord]
  [DomainValidationRecord]
-> Iso
     (Maybe [DomainValidationRecord])
     (Maybe [DomainValidationRecord])
     (Maybe [DomainValidationRecord])
     (Maybe [DomainValidationRecord])
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
  [DomainValidationRecord]
  [DomainValidationRecord]
  [DomainValidationRecord]
  [DomainValidationRecord]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The number of Lightsail resources that the certificate is attached to.
certificate_inUseResourceCount :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Int)
certificate_inUseResourceCount :: (Maybe Int -> f (Maybe Int)) -> Certificate -> f Certificate
certificate_inUseResourceCount = (Certificate -> Maybe Int)
-> (Certificate -> Maybe Int -> Certificate)
-> Lens Certificate Certificate (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Int
inUseResourceCount :: Maybe Int
$sel:inUseResourceCount:Certificate' :: Certificate -> Maybe Int
inUseResourceCount} -> Maybe Int
inUseResourceCount) (\s :: Certificate
s@Certificate' {} Maybe Int
a -> Certificate
s {$sel:inUseResourceCount:Certificate' :: Maybe Int
inUseResourceCount = Maybe Int
a} :: Certificate)

-- | The timestamp when the certificate was issued.
certificate_issuedAt :: Lens.Lens' Certificate (Prelude.Maybe Prelude.UTCTime)
certificate_issuedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate -> f Certificate
certificate_issuedAt = (Certificate -> Maybe POSIX)
-> (Certificate -> Maybe POSIX -> Certificate)
-> Lens Certificate Certificate (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe POSIX
issuedAt :: Maybe POSIX
$sel:issuedAt:Certificate' :: Certificate -> Maybe POSIX
issuedAt} -> Maybe POSIX
issuedAt) (\s :: Certificate
s@Certificate' {} Maybe POSIX
a -> Certificate
s {$sel:issuedAt:Certificate' :: Maybe POSIX
issuedAt = Maybe POSIX
a} :: Certificate) ((Maybe POSIX -> f (Maybe POSIX)) -> Certificate -> f Certificate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate
-> f Certificate
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 algorithm used to generate the key pair (the public and private key)
-- of the certificate.
certificate_keyAlgorithm :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_keyAlgorithm :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_keyAlgorithm = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
keyAlgorithm :: Maybe Text
$sel:keyAlgorithm:Certificate' :: Certificate -> Maybe Text
keyAlgorithm} -> Maybe Text
keyAlgorithm) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:keyAlgorithm:Certificate' :: Maybe Text
keyAlgorithm = Maybe Text
a} :: Certificate)

-- | The serial number of the certificate.
certificate_serialNumber :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_serialNumber :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_serialNumber = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
serialNumber :: Maybe Text
$sel:serialNumber:Certificate' :: Certificate -> Maybe Text
serialNumber} -> Maybe Text
serialNumber) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:serialNumber:Certificate' :: Maybe Text
serialNumber = Maybe Text
a} :: Certificate)

-- | The certificate authority that issued the certificate.
certificate_issuerCA :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_issuerCA :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_issuerCA = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
issuerCA :: Maybe Text
$sel:issuerCA:Certificate' :: Certificate -> Maybe Text
issuerCA} -> Maybe Text
issuerCA) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:issuerCA:Certificate' :: Maybe Text
issuerCA = Maybe Text
a} :: Certificate)

-- | The tag keys and optional values for the resource. For more information
-- about tags in Lightsail, see the
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags Amazon Lightsail Developer Guide>.
certificate_tags :: Lens.Lens' Certificate (Prelude.Maybe [Tag])
certificate_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> Certificate -> f Certificate
certificate_tags = (Certificate -> Maybe [Tag])
-> (Certificate -> Maybe [Tag] -> Certificate)
-> Lens Certificate Certificate (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:Certificate' :: Certificate -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: Certificate
s@Certificate' {} Maybe [Tag]
a -> Certificate
s {$sel:tags:Certificate' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: Certificate) ((Maybe [Tag] -> f (Maybe [Tag])) -> Certificate -> f Certificate)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> Certificate
-> f Certificate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The timestamp when the certificate expires.
certificate_notAfter :: Lens.Lens' Certificate (Prelude.Maybe Prelude.UTCTime)
certificate_notAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate -> f Certificate
certificate_notAfter = (Certificate -> Maybe POSIX)
-> (Certificate -> Maybe POSIX -> Certificate)
-> Lens Certificate Certificate (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe POSIX
notAfter :: Maybe POSIX
$sel:notAfter:Certificate' :: Certificate -> Maybe POSIX
notAfter} -> Maybe POSIX
notAfter) (\s :: Certificate
s@Certificate' {} Maybe POSIX
a -> Certificate
s {$sel:notAfter:Certificate' :: Maybe POSIX
notAfter = Maybe POSIX
a} :: Certificate) ((Maybe POSIX -> f (Maybe POSIX)) -> Certificate -> f Certificate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate
-> f Certificate
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

instance Core.FromJSON Certificate where
  parseJSON :: Value -> Parser Certificate
parseJSON =
    String
-> (Object -> Parser Certificate) -> Value -> Parser Certificate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Certificate"
      ( \Object
x ->
          Maybe CertificateStatus
-> Maybe [Text]
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe RenewalSummary
-> Maybe Text
-> Maybe [DomainValidationRecord]
-> Maybe Int
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Maybe POSIX
-> Certificate
Certificate'
            (Maybe CertificateStatus
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe RenewalSummary
 -> Maybe Text
 -> Maybe [DomainValidationRecord]
 -> Maybe Int
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Tag]
 -> Maybe POSIX
 -> Certificate)
-> Parser (Maybe CertificateStatus)
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RenewalSummary
      -> Maybe Text
      -> Maybe [DomainValidationRecord]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
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 Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RenewalSummary
   -> Maybe Text
   -> Maybe [DomainValidationRecord]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RenewalSummary
      -> Maybe Text
      -> Maybe [DomainValidationRecord]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"subjectAlternativeNames"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RenewalSummary
   -> Maybe Text
   -> Maybe [DomainValidationRecord]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RenewalSummary
      -> Maybe Text
      -> Maybe [DomainValidationRecord]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
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
"arn")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RenewalSummary
   -> Maybe Text
   -> Maybe [DomainValidationRecord]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RenewalSummary
      -> Maybe Text
      -> Maybe [DomainValidationRecord]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
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
"createdAt")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RenewalSummary
   -> Maybe Text
   -> Maybe [DomainValidationRecord]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RenewalSummary
      -> Maybe Text
      -> Maybe [DomainValidationRecord]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
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
"eligibleToRenew")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RenewalSummary
   -> Maybe Text
   -> Maybe [DomainValidationRecord]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RenewalSummary
      -> Maybe Text
      -> Maybe [DomainValidationRecord]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
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
"requestFailureReason")
            Parser
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RenewalSummary
   -> Maybe Text
   -> Maybe [DomainValidationRecord]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RenewalSummary
      -> Maybe Text
      -> Maybe [DomainValidationRecord]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
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
"revokedAt")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RenewalSummary
   -> Maybe Text
   -> Maybe [DomainValidationRecord]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RenewalSummary
      -> Maybe Text
      -> Maybe [DomainValidationRecord]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
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
"notBefore")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RenewalSummary
   -> Maybe Text
   -> Maybe [DomainValidationRecord]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe RenewalSummary
      -> Maybe Text
      -> Maybe [DomainValidationRecord]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
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
"revocationReason")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe RenewalSummary
   -> Maybe Text
   -> Maybe [DomainValidationRecord]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe RenewalSummary
      -> Maybe Text
      -> Maybe [DomainValidationRecord]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
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
"domainName")
            Parser
  (Maybe Text
   -> Maybe RenewalSummary
   -> Maybe Text
   -> Maybe [DomainValidationRecord]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe RenewalSummary
      -> Maybe Text
      -> Maybe [DomainValidationRecord]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
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
"name")
            Parser
  (Maybe RenewalSummary
   -> Maybe Text
   -> Maybe [DomainValidationRecord]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe RenewalSummary)
-> Parser
     (Maybe Text
      -> Maybe [DomainValidationRecord]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RenewalSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"renewalSummary")
            Parser
  (Maybe Text
   -> Maybe [DomainValidationRecord]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe [DomainValidationRecord]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
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
"supportCode")
            Parser
  (Maybe [DomainValidationRecord]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe [DomainValidationRecord])
-> Parser
     (Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [DomainValidationRecord]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"domainValidationRecords"
                            Parser (Maybe (Maybe [DomainValidationRecord]))
-> Maybe [DomainValidationRecord]
-> Parser (Maybe [DomainValidationRecord])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [DomainValidationRecord]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe Int)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"inUseResourceCount")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe POSIX
      -> Certificate)
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
"issuedAt")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe POSIX
   -> Certificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe [Tag] -> Maybe POSIX -> Certificate)
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
"keyAlgorithm")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe [Tag] -> Maybe POSIX -> Certificate)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Tag] -> Maybe POSIX -> Certificate)
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
"serialNumber")
            Parser (Maybe Text -> Maybe [Tag] -> Maybe POSIX -> Certificate)
-> Parser (Maybe Text)
-> Parser (Maybe [Tag] -> Maybe POSIX -> Certificate)
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
"issuerCA")
            Parser (Maybe [Tag] -> Maybe POSIX -> Certificate)
-> Parser (Maybe [Tag]) -> Parser (Maybe POSIX -> Certificate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe POSIX -> Certificate)
-> Parser (Maybe POSIX) -> Parser Certificate
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
"notAfter")
      )

instance Prelude.Hashable Certificate

instance Prelude.NFData Certificate