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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | 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,
    -- | 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]
  }
  deriving (LoadBalancerTlsCertificateRenewalSummary
-> LoadBalancerTlsCertificateRenewalSummary -> Bool
(LoadBalancerTlsCertificateRenewalSummary
 -> LoadBalancerTlsCertificateRenewalSummary -> Bool)
-> (LoadBalancerTlsCertificateRenewalSummary
    -> LoadBalancerTlsCertificateRenewalSummary -> Bool)
-> Eq LoadBalancerTlsCertificateRenewalSummary
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]
(Int -> ReadS LoadBalancerTlsCertificateRenewalSummary)
-> ReadS [LoadBalancerTlsCertificateRenewalSummary]
-> ReadPrec LoadBalancerTlsCertificateRenewalSummary
-> ReadPrec [LoadBalancerTlsCertificateRenewalSummary]
-> Read 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
(Int -> LoadBalancerTlsCertificateRenewalSummary -> ShowS)
-> (LoadBalancerTlsCertificateRenewalSummary -> String)
-> ([LoadBalancerTlsCertificateRenewalSummary] -> ShowS)
-> Show LoadBalancerTlsCertificateRenewalSummary
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.
 LoadBalancerTlsCertificateRenewalSummary
 -> Rep LoadBalancerTlsCertificateRenewalSummary x)
-> (forall x.
    Rep LoadBalancerTlsCertificateRenewalSummary x
    -> LoadBalancerTlsCertificateRenewalSummary)
-> Generic LoadBalancerTlsCertificateRenewalSummary
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:
--
-- '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.
--
-- '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.
newLoadBalancerTlsCertificateRenewalSummary ::
  LoadBalancerTlsCertificateRenewalSummary
newLoadBalancerTlsCertificateRenewalSummary :: LoadBalancerTlsCertificateRenewalSummary
newLoadBalancerTlsCertificateRenewalSummary =
  LoadBalancerTlsCertificateRenewalSummary' :: Maybe LoadBalancerTlsCertificateRenewalStatus
-> Maybe [LoadBalancerTlsCertificateDomainValidationOption]
-> LoadBalancerTlsCertificateRenewalSummary
LoadBalancerTlsCertificateRenewalSummary'
    { $sel:renewalStatus:LoadBalancerTlsCertificateRenewalSummary' :: Maybe LoadBalancerTlsCertificateRenewalStatus
renewalStatus =
        Maybe LoadBalancerTlsCertificateRenewalStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:domainValidationOptions:LoadBalancerTlsCertificateRenewalSummary' :: Maybe [LoadBalancerTlsCertificateDomainValidationOption]
domainValidationOptions =
        Maybe [LoadBalancerTlsCertificateDomainValidationOption]
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe LoadBalancerTlsCertificateRenewalStatus
 -> f (Maybe LoadBalancerTlsCertificateRenewalStatus))
-> LoadBalancerTlsCertificateRenewalSummary
-> f LoadBalancerTlsCertificateRenewalSummary
loadBalancerTlsCertificateRenewalSummary_renewalStatus = (LoadBalancerTlsCertificateRenewalSummary
 -> Maybe LoadBalancerTlsCertificateRenewalStatus)
-> (LoadBalancerTlsCertificateRenewalSummary
    -> Maybe LoadBalancerTlsCertificateRenewalStatus
    -> LoadBalancerTlsCertificateRenewalSummary)
-> Lens
     LoadBalancerTlsCertificateRenewalSummary
     LoadBalancerTlsCertificateRenewalSummary
     (Maybe LoadBalancerTlsCertificateRenewalStatus)
     (Maybe LoadBalancerTlsCertificateRenewalStatus)
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)

-- | 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 :: (Maybe [LoadBalancerTlsCertificateDomainValidationOption]
 -> f (Maybe [LoadBalancerTlsCertificateDomainValidationOption]))
-> LoadBalancerTlsCertificateRenewalSummary
-> f LoadBalancerTlsCertificateRenewalSummary
loadBalancerTlsCertificateRenewalSummary_domainValidationOptions = (LoadBalancerTlsCertificateRenewalSummary
 -> Maybe [LoadBalancerTlsCertificateDomainValidationOption])
-> (LoadBalancerTlsCertificateRenewalSummary
    -> Maybe [LoadBalancerTlsCertificateDomainValidationOption]
    -> LoadBalancerTlsCertificateRenewalSummary)
-> Lens
     LoadBalancerTlsCertificateRenewalSummary
     LoadBalancerTlsCertificateRenewalSummary
     (Maybe [LoadBalancerTlsCertificateDomainValidationOption])
     (Maybe [LoadBalancerTlsCertificateDomainValidationOption])
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) ((Maybe [LoadBalancerTlsCertificateDomainValidationOption]
  -> f (Maybe [LoadBalancerTlsCertificateDomainValidationOption]))
 -> LoadBalancerTlsCertificateRenewalSummary
 -> f LoadBalancerTlsCertificateRenewalSummary)
-> ((Maybe [LoadBalancerTlsCertificateDomainValidationOption]
     -> f (Maybe [LoadBalancerTlsCertificateDomainValidationOption]))
    -> Maybe [LoadBalancerTlsCertificateDomainValidationOption]
    -> f (Maybe [LoadBalancerTlsCertificateDomainValidationOption]))
-> (Maybe [LoadBalancerTlsCertificateDomainValidationOption]
    -> f (Maybe [LoadBalancerTlsCertificateDomainValidationOption]))
-> LoadBalancerTlsCertificateRenewalSummary
-> f LoadBalancerTlsCertificateRenewalSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LoadBalancerTlsCertificateDomainValidationOption]
  [LoadBalancerTlsCertificateDomainValidationOption]
  [LoadBalancerTlsCertificateDomainValidationOption]
  [LoadBalancerTlsCertificateDomainValidationOption]
-> Iso
     (Maybe [LoadBalancerTlsCertificateDomainValidationOption])
     (Maybe [LoadBalancerTlsCertificateDomainValidationOption])
     (Maybe [LoadBalancerTlsCertificateDomainValidationOption])
     (Maybe [LoadBalancerTlsCertificateDomainValidationOption])
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
  [LoadBalancerTlsCertificateDomainValidationOption]
  [LoadBalancerTlsCertificateDomainValidationOption]
  [LoadBalancerTlsCertificateDomainValidationOption]
  [LoadBalancerTlsCertificateDomainValidationOption]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.FromJSON
    LoadBalancerTlsCertificateRenewalSummary
  where
  parseJSON :: Value -> Parser LoadBalancerTlsCertificateRenewalSummary
parseJSON =
    String
-> (Object -> Parser LoadBalancerTlsCertificateRenewalSummary)
-> Value
-> Parser LoadBalancerTlsCertificateRenewalSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LoadBalancerTlsCertificateRenewalSummary"
      ( \Object
x ->
          Maybe LoadBalancerTlsCertificateRenewalStatus
-> Maybe [LoadBalancerTlsCertificateDomainValidationOption]
-> LoadBalancerTlsCertificateRenewalSummary
LoadBalancerTlsCertificateRenewalSummary'
            (Maybe LoadBalancerTlsCertificateRenewalStatus
 -> Maybe [LoadBalancerTlsCertificateDomainValidationOption]
 -> LoadBalancerTlsCertificateRenewalSummary)
-> Parser (Maybe LoadBalancerTlsCertificateRenewalStatus)
-> Parser
     (Maybe [LoadBalancerTlsCertificateDomainValidationOption]
      -> LoadBalancerTlsCertificateRenewalSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser (Maybe LoadBalancerTlsCertificateRenewalStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"renewalStatus")
            Parser
  (Maybe [LoadBalancerTlsCertificateDomainValidationOption]
   -> LoadBalancerTlsCertificateRenewalSummary)
-> Parser
     (Maybe [LoadBalancerTlsCertificateDomainValidationOption])
-> Parser LoadBalancerTlsCertificateRenewalSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser
     (Maybe (Maybe [LoadBalancerTlsCertificateDomainValidationOption]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"domainValidationOptions"
                            Parser
  (Maybe (Maybe [LoadBalancerTlsCertificateDomainValidationOption]))
-> Maybe [LoadBalancerTlsCertificateDomainValidationOption]
-> Parser
     (Maybe [LoadBalancerTlsCertificateDomainValidationOption])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [LoadBalancerTlsCertificateDomainValidationOption]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance
  Prelude.Hashable
    LoadBalancerTlsCertificateRenewalSummary

instance
  Prelude.NFData
    LoadBalancerTlsCertificateRenewalSummary