{-# 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 #-}
module Amazonka.CertificateManager.Types.RenewalSummary where
import Amazonka.CertificateManager.Types.DomainValidation
import Amazonka.CertificateManager.Types.FailureReason
import Amazonka.CertificateManager.Types.RenewalStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RenewalSummary = RenewalSummary'
{
RenewalSummary -> Maybe FailureReason
renewalStatusReason :: Prelude.Maybe FailureReason,
RenewalSummary -> RenewalStatus
renewalStatus :: RenewalStatus,
RenewalSummary -> NonEmpty DomainValidation
domainValidationOptions :: Prelude.NonEmpty DomainValidation,
RenewalSummary -> POSIX
updatedAt :: Core.POSIX
}
deriving (RenewalSummary -> RenewalSummary -> Bool
(RenewalSummary -> RenewalSummary -> Bool)
-> (RenewalSummary -> RenewalSummary -> Bool) -> Eq RenewalSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RenewalSummary -> RenewalSummary -> Bool
$c/= :: RenewalSummary -> RenewalSummary -> Bool
== :: RenewalSummary -> RenewalSummary -> Bool
$c== :: RenewalSummary -> RenewalSummary -> Bool
Prelude.Eq, ReadPrec [RenewalSummary]
ReadPrec RenewalSummary
Int -> ReadS RenewalSummary
ReadS [RenewalSummary]
(Int -> ReadS RenewalSummary)
-> ReadS [RenewalSummary]
-> ReadPrec RenewalSummary
-> ReadPrec [RenewalSummary]
-> Read RenewalSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RenewalSummary]
$creadListPrec :: ReadPrec [RenewalSummary]
readPrec :: ReadPrec RenewalSummary
$creadPrec :: ReadPrec RenewalSummary
readList :: ReadS [RenewalSummary]
$creadList :: ReadS [RenewalSummary]
readsPrec :: Int -> ReadS RenewalSummary
$creadsPrec :: Int -> ReadS RenewalSummary
Prelude.Read, Int -> RenewalSummary -> ShowS
[RenewalSummary] -> ShowS
RenewalSummary -> String
(Int -> RenewalSummary -> ShowS)
-> (RenewalSummary -> String)
-> ([RenewalSummary] -> ShowS)
-> Show RenewalSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RenewalSummary] -> ShowS
$cshowList :: [RenewalSummary] -> ShowS
show :: RenewalSummary -> String
$cshow :: RenewalSummary -> String
showsPrec :: Int -> RenewalSummary -> ShowS
$cshowsPrec :: Int -> RenewalSummary -> ShowS
Prelude.Show, (forall x. RenewalSummary -> Rep RenewalSummary x)
-> (forall x. Rep RenewalSummary x -> RenewalSummary)
-> Generic RenewalSummary
forall x. Rep RenewalSummary x -> RenewalSummary
forall x. RenewalSummary -> Rep RenewalSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RenewalSummary x -> RenewalSummary
$cfrom :: forall x. RenewalSummary -> Rep RenewalSummary x
Prelude.Generic)
newRenewalSummary ::
RenewalStatus ->
Prelude.NonEmpty DomainValidation ->
Prelude.UTCTime ->
RenewalSummary
newRenewalSummary :: RenewalStatus
-> NonEmpty DomainValidation -> UTCTime -> RenewalSummary
newRenewalSummary
RenewalStatus
pRenewalStatus_
NonEmpty DomainValidation
pDomainValidationOptions_
UTCTime
pUpdatedAt_ =
RenewalSummary' :: Maybe FailureReason
-> RenewalStatus
-> NonEmpty DomainValidation
-> POSIX
-> RenewalSummary
RenewalSummary'
{ $sel:renewalStatusReason:RenewalSummary' :: Maybe FailureReason
renewalStatusReason =
Maybe FailureReason
forall a. Maybe a
Prelude.Nothing,
$sel:renewalStatus:RenewalSummary' :: RenewalStatus
renewalStatus = RenewalStatus
pRenewalStatus_,
$sel:domainValidationOptions:RenewalSummary' :: NonEmpty DomainValidation
domainValidationOptions =
Tagged
(NonEmpty DomainValidation) (Identity (NonEmpty DomainValidation))
-> Tagged
(NonEmpty DomainValidation) (Identity (NonEmpty DomainValidation))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
(NonEmpty DomainValidation) (Identity (NonEmpty DomainValidation))
-> Tagged
(NonEmpty DomainValidation) (Identity (NonEmpty DomainValidation)))
-> NonEmpty DomainValidation -> NonEmpty DomainValidation
forall t b. AReview t b -> b -> t
Lens.# NonEmpty DomainValidation
pDomainValidationOptions_,
$sel:updatedAt:RenewalSummary' :: POSIX
updatedAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdatedAt_
}
renewalSummary_renewalStatusReason :: Lens.Lens' RenewalSummary (Prelude.Maybe FailureReason)
renewalSummary_renewalStatusReason :: (Maybe FailureReason -> f (Maybe FailureReason))
-> RenewalSummary -> f RenewalSummary
renewalSummary_renewalStatusReason = (RenewalSummary -> Maybe FailureReason)
-> (RenewalSummary -> Maybe FailureReason -> RenewalSummary)
-> Lens
RenewalSummary
RenewalSummary
(Maybe FailureReason)
(Maybe FailureReason)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenewalSummary' {Maybe FailureReason
renewalStatusReason :: Maybe FailureReason
$sel:renewalStatusReason:RenewalSummary' :: RenewalSummary -> Maybe FailureReason
renewalStatusReason} -> Maybe FailureReason
renewalStatusReason) (\s :: RenewalSummary
s@RenewalSummary' {} Maybe FailureReason
a -> RenewalSummary
s {$sel:renewalStatusReason:RenewalSummary' :: Maybe FailureReason
renewalStatusReason = Maybe FailureReason
a} :: RenewalSummary)
renewalSummary_renewalStatus :: Lens.Lens' RenewalSummary RenewalStatus
renewalSummary_renewalStatus :: (RenewalStatus -> f RenewalStatus)
-> RenewalSummary -> f RenewalSummary
renewalSummary_renewalStatus = (RenewalSummary -> RenewalStatus)
-> (RenewalSummary -> RenewalStatus -> RenewalSummary)
-> Lens RenewalSummary RenewalSummary RenewalStatus RenewalStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenewalSummary' {RenewalStatus
renewalStatus :: RenewalStatus
$sel:renewalStatus:RenewalSummary' :: RenewalSummary -> RenewalStatus
renewalStatus} -> RenewalStatus
renewalStatus) (\s :: RenewalSummary
s@RenewalSummary' {} RenewalStatus
a -> RenewalSummary
s {$sel:renewalStatus:RenewalSummary' :: RenewalStatus
renewalStatus = RenewalStatus
a} :: RenewalSummary)
renewalSummary_domainValidationOptions :: Lens.Lens' RenewalSummary (Prelude.NonEmpty DomainValidation)
renewalSummary_domainValidationOptions :: (NonEmpty DomainValidation -> f (NonEmpty DomainValidation))
-> RenewalSummary -> f RenewalSummary
renewalSummary_domainValidationOptions = (RenewalSummary -> NonEmpty DomainValidation)
-> (RenewalSummary -> NonEmpty DomainValidation -> RenewalSummary)
-> Lens
RenewalSummary
RenewalSummary
(NonEmpty DomainValidation)
(NonEmpty DomainValidation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenewalSummary' {NonEmpty DomainValidation
domainValidationOptions :: NonEmpty DomainValidation
$sel:domainValidationOptions:RenewalSummary' :: RenewalSummary -> NonEmpty DomainValidation
domainValidationOptions} -> NonEmpty DomainValidation
domainValidationOptions) (\s :: RenewalSummary
s@RenewalSummary' {} NonEmpty DomainValidation
a -> RenewalSummary
s {$sel:domainValidationOptions:RenewalSummary' :: NonEmpty DomainValidation
domainValidationOptions = NonEmpty DomainValidation
a} :: RenewalSummary) ((NonEmpty DomainValidation -> f (NonEmpty DomainValidation))
-> RenewalSummary -> f RenewalSummary)
-> ((NonEmpty DomainValidation -> f (NonEmpty DomainValidation))
-> NonEmpty DomainValidation -> f (NonEmpty DomainValidation))
-> (NonEmpty DomainValidation -> f (NonEmpty DomainValidation))
-> RenewalSummary
-> f RenewalSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty DomainValidation -> f (NonEmpty DomainValidation))
-> NonEmpty DomainValidation -> f (NonEmpty DomainValidation)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
renewalSummary_updatedAt :: Lens.Lens' RenewalSummary Prelude.UTCTime
renewalSummary_updatedAt :: (UTCTime -> f UTCTime) -> RenewalSummary -> f RenewalSummary
renewalSummary_updatedAt = (RenewalSummary -> POSIX)
-> (RenewalSummary -> POSIX -> RenewalSummary)
-> Lens RenewalSummary RenewalSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenewalSummary' {POSIX
updatedAt :: POSIX
$sel:updatedAt:RenewalSummary' :: RenewalSummary -> POSIX
updatedAt} -> POSIX
updatedAt) (\s :: RenewalSummary
s@RenewalSummary' {} POSIX
a -> RenewalSummary
s {$sel:updatedAt:RenewalSummary' :: POSIX
updatedAt = POSIX
a} :: RenewalSummary) ((POSIX -> f POSIX) -> RenewalSummary -> f RenewalSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> RenewalSummary
-> f RenewalSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON RenewalSummary where
parseJSON :: Value -> Parser RenewalSummary
parseJSON =
String
-> (Object -> Parser RenewalSummary)
-> Value
-> Parser RenewalSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RenewalSummary"
( \Object
x ->
Maybe FailureReason
-> RenewalStatus
-> NonEmpty DomainValidation
-> POSIX
-> RenewalSummary
RenewalSummary'
(Maybe FailureReason
-> RenewalStatus
-> NonEmpty DomainValidation
-> POSIX
-> RenewalSummary)
-> Parser (Maybe FailureReason)
-> Parser
(RenewalStatus
-> NonEmpty DomainValidation -> POSIX -> RenewalSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe FailureReason)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RenewalStatusReason")
Parser
(RenewalStatus
-> NonEmpty DomainValidation -> POSIX -> RenewalSummary)
-> Parser RenewalStatus
-> Parser (NonEmpty DomainValidation -> POSIX -> RenewalSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser RenewalStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RenewalStatus")
Parser (NonEmpty DomainValidation -> POSIX -> RenewalSummary)
-> Parser (NonEmpty DomainValidation)
-> Parser (POSIX -> RenewalSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (NonEmpty DomainValidation)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DomainValidationOptions")
Parser (POSIX -> RenewalSummary)
-> Parser POSIX -> Parser RenewalSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"UpdatedAt")
)
instance Prelude.Hashable RenewalSummary
instance Prelude.NFData RenewalSummary