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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types.LoadBalancerTlsCertificateDomainValidationOption
import Amazonka.Lightsail.Types.LoadBalancerTlsCertificateRenewalStatus
import qualified Amazonka.Prelude as Prelude

-- | Contains information about the status of Lightsail\'s managed renewal
-- for the certificate.
--
-- The renewal status of the certificate.
--
-- The following renewal status are possible:
--
-- -   __@PendingAutoRenewal@__ - Lightsail is attempting to automatically
--     validate the domain names in the certificate. No further action is
--     required.
--
-- -   __@PendingValidation@__ - Lightsail couldn\'t automatically validate
--     one or more domain names in the certificate. You must take action to
--     validate these domain names or the certificate won\'t be renewed. If
--     you used DNS validation, check to make sure your certificate\'s
--     domain validation records exist in your domain\'s DNS, and that your
--     certificate remains in use.
--
-- -   __@Success@__ - All domain names in the certificate are validated,
--     and Lightsail renewed the certificate. No further action is
--     required.
--
-- -   __@Failed@__ - One or more domain names were not validated before
--     the certificate expired, and Lightsail did not renew the
--     certificate. You can request a new certificate using the
--     @CreateCertificate@ action.
--
-- /See:/ 'newLoadBalancerTlsCertificateRenewalSummary' smart constructor.
data LoadBalancerTlsCertificateRenewalSummary = LoadBalancerTlsCertificateRenewalSummary'
  { -- | Contains information about the validation of each domain name in the
    -- certificate, as it pertains to Lightsail\'s managed renewal. This is
    -- different from the initial validation that occurs as a result of the
    -- RequestCertificate request.
    LoadBalancerTlsCertificateRenewalSummary
-> Maybe [LoadBalancerTlsCertificateDomainValidationOption]
domainValidationOptions :: Prelude.Maybe [LoadBalancerTlsCertificateDomainValidationOption],
    -- | The renewal status of the certificate.
    --
    -- The following renewal status are possible:
    --
    -- -   __@PendingAutoRenewal@__ - Lightsail is attempting to automatically
    --     validate the domain names of the certificate. No further action is
    --     required.
    --
    -- -   __@PendingValidation@__ - Lightsail couldn\'t automatically validate
    --     one or more domain names of the certificate. You must take action to
    --     validate these domain names or the certificate won\'t be renewed.
    --     Check to make sure your certificate\'s domain validation records
    --     exist in your domain\'s DNS, and that your certificate remains in
    --     use.
    --
    -- -   __@Success@__ - All domain names in the certificate are validated,
    --     and Lightsail renewed the certificate. No further action is
    --     required.
    --
    -- -   __@Failed@__ - One or more domain names were not validated before
    --     the certificate expired, and Lightsail did not renew the
    --     certificate. You can request a new certificate using the
    --     @CreateCertificate@ action.
    LoadBalancerTlsCertificateRenewalSummary
-> Maybe LoadBalancerTlsCertificateRenewalStatus
renewalStatus :: Prelude.Maybe LoadBalancerTlsCertificateRenewalStatus
  }
  deriving (LoadBalancerTlsCertificateRenewalSummary
-> LoadBalancerTlsCertificateRenewalSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoadBalancerTlsCertificateRenewalSummary
-> LoadBalancerTlsCertificateRenewalSummary -> Bool
$c/= :: LoadBalancerTlsCertificateRenewalSummary
-> LoadBalancerTlsCertificateRenewalSummary -> Bool
== :: LoadBalancerTlsCertificateRenewalSummary
-> LoadBalancerTlsCertificateRenewalSummary -> Bool
$c== :: LoadBalancerTlsCertificateRenewalSummary
-> LoadBalancerTlsCertificateRenewalSummary -> Bool
Prelude.Eq, ReadPrec [LoadBalancerTlsCertificateRenewalSummary]
ReadPrec LoadBalancerTlsCertificateRenewalSummary
Int -> ReadS LoadBalancerTlsCertificateRenewalSummary
ReadS [LoadBalancerTlsCertificateRenewalSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoadBalancerTlsCertificateRenewalSummary]
$creadListPrec :: ReadPrec [LoadBalancerTlsCertificateRenewalSummary]
readPrec :: ReadPrec LoadBalancerTlsCertificateRenewalSummary
$creadPrec :: ReadPrec LoadBalancerTlsCertificateRenewalSummary
readList :: ReadS [LoadBalancerTlsCertificateRenewalSummary]
$creadList :: ReadS [LoadBalancerTlsCertificateRenewalSummary]
readsPrec :: Int -> ReadS LoadBalancerTlsCertificateRenewalSummary
$creadsPrec :: Int -> ReadS LoadBalancerTlsCertificateRenewalSummary
Prelude.Read, Int -> LoadBalancerTlsCertificateRenewalSummary -> ShowS
[LoadBalancerTlsCertificateRenewalSummary] -> ShowS
LoadBalancerTlsCertificateRenewalSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoadBalancerTlsCertificateRenewalSummary] -> ShowS
$cshowList :: [LoadBalancerTlsCertificateRenewalSummary] -> ShowS
show :: LoadBalancerTlsCertificateRenewalSummary -> String
$cshow :: LoadBalancerTlsCertificateRenewalSummary -> String
showsPrec :: Int -> LoadBalancerTlsCertificateRenewalSummary -> ShowS
$cshowsPrec :: Int -> LoadBalancerTlsCertificateRenewalSummary -> ShowS
Prelude.Show, forall x.
Rep LoadBalancerTlsCertificateRenewalSummary x
-> LoadBalancerTlsCertificateRenewalSummary
forall x.
LoadBalancerTlsCertificateRenewalSummary
-> Rep LoadBalancerTlsCertificateRenewalSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LoadBalancerTlsCertificateRenewalSummary x
-> LoadBalancerTlsCertificateRenewalSummary
$cfrom :: forall x.
LoadBalancerTlsCertificateRenewalSummary
-> Rep LoadBalancerTlsCertificateRenewalSummary x
Prelude.Generic)

-- |
-- Create a value of 'LoadBalancerTlsCertificateRenewalSummary' 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:
--
-- 'domainValidationOptions', 'loadBalancerTlsCertificateRenewalSummary_domainValidationOptions' - Contains information about the validation of each domain name in the
-- certificate, as it pertains to Lightsail\'s managed renewal. This is
-- different from the initial validation that occurs as a result of the
-- RequestCertificate request.
--
-- 'renewalStatus', 'loadBalancerTlsCertificateRenewalSummary_renewalStatus' - The renewal status of the certificate.
--
-- The following renewal status are possible:
--
-- -   __@PendingAutoRenewal@__ - Lightsail is attempting to automatically
--     validate the domain names of the certificate. No further action is
--     required.
--
-- -   __@PendingValidation@__ - Lightsail couldn\'t automatically validate
--     one or more domain names of the certificate. You must take action to
--     validate these domain names or the certificate won\'t be renewed.
--     Check to make sure your certificate\'s domain validation records
--     exist in your domain\'s DNS, and that your certificate remains in
--     use.
--
-- -   __@Success@__ - All domain names in the certificate are validated,
--     and Lightsail renewed the certificate. No further action is
--     required.
--
-- -   __@Failed@__ - One or more domain names were not validated before
--     the certificate expired, and Lightsail did not renew the
--     certificate. You can request a new certificate using the
--     @CreateCertificate@ action.
newLoadBalancerTlsCertificateRenewalSummary ::
  LoadBalancerTlsCertificateRenewalSummary
newLoadBalancerTlsCertificateRenewalSummary :: LoadBalancerTlsCertificateRenewalSummary
newLoadBalancerTlsCertificateRenewalSummary =
  LoadBalancerTlsCertificateRenewalSummary'
    { $sel:domainValidationOptions:LoadBalancerTlsCertificateRenewalSummary' :: Maybe [LoadBalancerTlsCertificateDomainValidationOption]
domainValidationOptions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:renewalStatus:LoadBalancerTlsCertificateRenewalSummary' :: Maybe LoadBalancerTlsCertificateRenewalStatus
renewalStatus = forall a. Maybe a
Prelude.Nothing
    }

-- | Contains information about the validation of each domain name in the
-- certificate, as it pertains to Lightsail\'s managed renewal. This is
-- different from the initial validation that occurs as a result of the
-- RequestCertificate request.
loadBalancerTlsCertificateRenewalSummary_domainValidationOptions :: Lens.Lens' LoadBalancerTlsCertificateRenewalSummary (Prelude.Maybe [LoadBalancerTlsCertificateDomainValidationOption])
loadBalancerTlsCertificateRenewalSummary_domainValidationOptions :: Lens'
  LoadBalancerTlsCertificateRenewalSummary
  (Maybe [LoadBalancerTlsCertificateDomainValidationOption])
loadBalancerTlsCertificateRenewalSummary_domainValidationOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerTlsCertificateRenewalSummary' {Maybe [LoadBalancerTlsCertificateDomainValidationOption]
domainValidationOptions :: Maybe [LoadBalancerTlsCertificateDomainValidationOption]
$sel:domainValidationOptions:LoadBalancerTlsCertificateRenewalSummary' :: LoadBalancerTlsCertificateRenewalSummary
-> Maybe [LoadBalancerTlsCertificateDomainValidationOption]
domainValidationOptions} -> Maybe [LoadBalancerTlsCertificateDomainValidationOption]
domainValidationOptions) (\s :: LoadBalancerTlsCertificateRenewalSummary
s@LoadBalancerTlsCertificateRenewalSummary' {} Maybe [LoadBalancerTlsCertificateDomainValidationOption]
a -> LoadBalancerTlsCertificateRenewalSummary
s {$sel:domainValidationOptions:LoadBalancerTlsCertificateRenewalSummary' :: Maybe [LoadBalancerTlsCertificateDomainValidationOption]
domainValidationOptions = Maybe [LoadBalancerTlsCertificateDomainValidationOption]
a} :: LoadBalancerTlsCertificateRenewalSummary) 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

-- | The renewal status of the certificate.
--
-- The following renewal status are possible:
--
-- -   __@PendingAutoRenewal@__ - Lightsail is attempting to automatically
--     validate the domain names of the certificate. No further action is
--     required.
--
-- -   __@PendingValidation@__ - Lightsail couldn\'t automatically validate
--     one or more domain names of the certificate. You must take action to
--     validate these domain names or the certificate won\'t be renewed.
--     Check to make sure your certificate\'s domain validation records
--     exist in your domain\'s DNS, and that your certificate remains in
--     use.
--
-- -   __@Success@__ - All domain names in the certificate are validated,
--     and Lightsail renewed the certificate. No further action is
--     required.
--
-- -   __@Failed@__ - One or more domain names were not validated before
--     the certificate expired, and Lightsail did not renew the
--     certificate. You can request a new certificate using the
--     @CreateCertificate@ action.
loadBalancerTlsCertificateRenewalSummary_renewalStatus :: Lens.Lens' LoadBalancerTlsCertificateRenewalSummary (Prelude.Maybe LoadBalancerTlsCertificateRenewalStatus)
loadBalancerTlsCertificateRenewalSummary_renewalStatus :: Lens'
  LoadBalancerTlsCertificateRenewalSummary
  (Maybe LoadBalancerTlsCertificateRenewalStatus)
loadBalancerTlsCertificateRenewalSummary_renewalStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBalancerTlsCertificateRenewalSummary' {Maybe LoadBalancerTlsCertificateRenewalStatus
renewalStatus :: Maybe LoadBalancerTlsCertificateRenewalStatus
$sel:renewalStatus:LoadBalancerTlsCertificateRenewalSummary' :: LoadBalancerTlsCertificateRenewalSummary
-> Maybe LoadBalancerTlsCertificateRenewalStatus
renewalStatus} -> Maybe LoadBalancerTlsCertificateRenewalStatus
renewalStatus) (\s :: LoadBalancerTlsCertificateRenewalSummary
s@LoadBalancerTlsCertificateRenewalSummary' {} Maybe LoadBalancerTlsCertificateRenewalStatus
a -> LoadBalancerTlsCertificateRenewalSummary
s {$sel:renewalStatus:LoadBalancerTlsCertificateRenewalSummary' :: Maybe LoadBalancerTlsCertificateRenewalStatus
renewalStatus = Maybe LoadBalancerTlsCertificateRenewalStatus
a} :: LoadBalancerTlsCertificateRenewalSummary)

instance
  Data.FromJSON
    LoadBalancerTlsCertificateRenewalSummary
  where
  parseJSON :: Value -> Parser LoadBalancerTlsCertificateRenewalSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LoadBalancerTlsCertificateRenewalSummary"
      ( \Object
x ->
          Maybe [LoadBalancerTlsCertificateDomainValidationOption]
-> Maybe LoadBalancerTlsCertificateRenewalStatus
-> LoadBalancerTlsCertificateRenewalSummary
LoadBalancerTlsCertificateRenewalSummary'
            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
"domainValidationOptions"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"renewalStatus")
      )

instance
  Prelude.Hashable
    LoadBalancerTlsCertificateRenewalSummary
  where
  hashWithSalt :: Int -> LoadBalancerTlsCertificateRenewalSummary -> Int
hashWithSalt
    Int
_salt
    LoadBalancerTlsCertificateRenewalSummary' {Maybe [LoadBalancerTlsCertificateDomainValidationOption]
Maybe LoadBalancerTlsCertificateRenewalStatus
renewalStatus :: Maybe LoadBalancerTlsCertificateRenewalStatus
domainValidationOptions :: Maybe [LoadBalancerTlsCertificateDomainValidationOption]
$sel:renewalStatus:LoadBalancerTlsCertificateRenewalSummary' :: LoadBalancerTlsCertificateRenewalSummary
-> Maybe LoadBalancerTlsCertificateRenewalStatus
$sel:domainValidationOptions:LoadBalancerTlsCertificateRenewalSummary' :: LoadBalancerTlsCertificateRenewalSummary
-> Maybe [LoadBalancerTlsCertificateDomainValidationOption]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [LoadBalancerTlsCertificateDomainValidationOption]
domainValidationOptions
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LoadBalancerTlsCertificateRenewalStatus
renewalStatus

instance
  Prelude.NFData
    LoadBalancerTlsCertificateRenewalSummary
  where
  rnf :: LoadBalancerTlsCertificateRenewalSummary -> ()
rnf LoadBalancerTlsCertificateRenewalSummary' {Maybe [LoadBalancerTlsCertificateDomainValidationOption]
Maybe LoadBalancerTlsCertificateRenewalStatus
renewalStatus :: Maybe LoadBalancerTlsCertificateRenewalStatus
domainValidationOptions :: Maybe [LoadBalancerTlsCertificateDomainValidationOption]
$sel:renewalStatus:LoadBalancerTlsCertificateRenewalSummary' :: LoadBalancerTlsCertificateRenewalSummary
-> Maybe LoadBalancerTlsCertificateRenewalStatus
$sel:domainValidationOptions:LoadBalancerTlsCertificateRenewalSummary' :: LoadBalancerTlsCertificateRenewalSummary
-> Maybe [LoadBalancerTlsCertificateDomainValidationOption]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [LoadBalancerTlsCertificateDomainValidationOption]
domainValidationOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LoadBalancerTlsCertificateRenewalStatus
renewalStatus