{-# 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.Lightsail.Types.RenewalSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.DomainValidationRecord
import Amazonka.Lightsail.Types.RenewalStatus
import qualified Amazonka.Prelude as Prelude
data RenewalSummary = RenewalSummary'
{
RenewalSummary -> Maybe RenewalStatus
renewalStatus :: Prelude.Maybe RenewalStatus,
RenewalSummary -> Maybe [DomainValidationRecord]
domainValidationRecords :: Prelude.Maybe [DomainValidationRecord],
RenewalSummary -> Maybe POSIX
updatedAt :: Prelude.Maybe Core.POSIX,
RenewalSummary -> Maybe Text
renewalStatusReason :: Prelude.Maybe Prelude.Text
}
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 ::
RenewalSummary
newRenewalSummary :: RenewalSummary
newRenewalSummary =
RenewalSummary' :: Maybe RenewalStatus
-> Maybe [DomainValidationRecord]
-> Maybe POSIX
-> Maybe Text
-> RenewalSummary
RenewalSummary'
{ $sel:renewalStatus:RenewalSummary' :: Maybe RenewalStatus
renewalStatus = Maybe RenewalStatus
forall a. Maybe a
Prelude.Nothing,
$sel:domainValidationRecords:RenewalSummary' :: Maybe [DomainValidationRecord]
domainValidationRecords = Maybe [DomainValidationRecord]
forall a. Maybe a
Prelude.Nothing,
$sel:updatedAt:RenewalSummary' :: Maybe POSIX
updatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:renewalStatusReason:RenewalSummary' :: Maybe Text
renewalStatusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
renewalSummary_renewalStatus :: Lens.Lens' RenewalSummary (Prelude.Maybe RenewalStatus)
renewalSummary_renewalStatus :: (Maybe RenewalStatus -> f (Maybe RenewalStatus))
-> RenewalSummary -> f RenewalSummary
renewalSummary_renewalStatus = (RenewalSummary -> Maybe RenewalStatus)
-> (RenewalSummary -> Maybe RenewalStatus -> RenewalSummary)
-> Lens
RenewalSummary
RenewalSummary
(Maybe RenewalStatus)
(Maybe RenewalStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenewalSummary' {Maybe RenewalStatus
renewalStatus :: Maybe RenewalStatus
$sel:renewalStatus:RenewalSummary' :: RenewalSummary -> Maybe RenewalStatus
renewalStatus} -> Maybe RenewalStatus
renewalStatus) (\s :: RenewalSummary
s@RenewalSummary' {} Maybe RenewalStatus
a -> RenewalSummary
s {$sel:renewalStatus:RenewalSummary' :: Maybe RenewalStatus
renewalStatus = Maybe RenewalStatus
a} :: RenewalSummary)
renewalSummary_domainValidationRecords :: Lens.Lens' RenewalSummary (Prelude.Maybe [DomainValidationRecord])
renewalSummary_domainValidationRecords :: (Maybe [DomainValidationRecord]
-> f (Maybe [DomainValidationRecord]))
-> RenewalSummary -> f RenewalSummary
renewalSummary_domainValidationRecords = (RenewalSummary -> Maybe [DomainValidationRecord])
-> (RenewalSummary
-> Maybe [DomainValidationRecord] -> RenewalSummary)
-> Lens
RenewalSummary
RenewalSummary
(Maybe [DomainValidationRecord])
(Maybe [DomainValidationRecord])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenewalSummary' {Maybe [DomainValidationRecord]
domainValidationRecords :: Maybe [DomainValidationRecord]
$sel:domainValidationRecords:RenewalSummary' :: RenewalSummary -> Maybe [DomainValidationRecord]
domainValidationRecords} -> Maybe [DomainValidationRecord]
domainValidationRecords) (\s :: RenewalSummary
s@RenewalSummary' {} Maybe [DomainValidationRecord]
a -> RenewalSummary
s {$sel:domainValidationRecords:RenewalSummary' :: Maybe [DomainValidationRecord]
domainValidationRecords = Maybe [DomainValidationRecord]
a} :: RenewalSummary) ((Maybe [DomainValidationRecord]
-> f (Maybe [DomainValidationRecord]))
-> RenewalSummary -> f RenewalSummary)
-> ((Maybe [DomainValidationRecord]
-> f (Maybe [DomainValidationRecord]))
-> Maybe [DomainValidationRecord]
-> f (Maybe [DomainValidationRecord]))
-> (Maybe [DomainValidationRecord]
-> f (Maybe [DomainValidationRecord]))
-> RenewalSummary
-> f RenewalSummary
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
renewalSummary_updatedAt :: Lens.Lens' RenewalSummary (Prelude.Maybe Prelude.UTCTime)
renewalSummary_updatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> RenewalSummary -> f RenewalSummary
renewalSummary_updatedAt = (RenewalSummary -> Maybe POSIX)
-> (RenewalSummary -> Maybe POSIX -> RenewalSummary)
-> Lens RenewalSummary RenewalSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenewalSummary' {Maybe POSIX
updatedAt :: Maybe POSIX
$sel:updatedAt:RenewalSummary' :: RenewalSummary -> Maybe POSIX
updatedAt} -> Maybe POSIX
updatedAt) (\s :: RenewalSummary
s@RenewalSummary' {} Maybe POSIX
a -> RenewalSummary
s {$sel:updatedAt:RenewalSummary' :: Maybe POSIX
updatedAt = Maybe POSIX
a} :: RenewalSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> RenewalSummary -> f RenewalSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> RenewalSummary
-> f RenewalSummary
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
renewalSummary_renewalStatusReason :: Lens.Lens' RenewalSummary (Prelude.Maybe Prelude.Text)
renewalSummary_renewalStatusReason :: (Maybe Text -> f (Maybe Text))
-> RenewalSummary -> f RenewalSummary
renewalSummary_renewalStatusReason = (RenewalSummary -> Maybe Text)
-> (RenewalSummary -> Maybe Text -> RenewalSummary)
-> Lens RenewalSummary RenewalSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenewalSummary' {Maybe Text
renewalStatusReason :: Maybe Text
$sel:renewalStatusReason:RenewalSummary' :: RenewalSummary -> Maybe Text
renewalStatusReason} -> Maybe Text
renewalStatusReason) (\s :: RenewalSummary
s@RenewalSummary' {} Maybe Text
a -> RenewalSummary
s {$sel:renewalStatusReason:RenewalSummary' :: Maybe Text
renewalStatusReason = Maybe Text
a} :: RenewalSummary)
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 RenewalStatus
-> Maybe [DomainValidationRecord]
-> Maybe POSIX
-> Maybe Text
-> RenewalSummary
RenewalSummary'
(Maybe RenewalStatus
-> Maybe [DomainValidationRecord]
-> Maybe POSIX
-> Maybe Text
-> RenewalSummary)
-> Parser (Maybe RenewalStatus)
-> Parser
(Maybe [DomainValidationRecord]
-> Maybe POSIX -> Maybe Text -> RenewalSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe RenewalStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"renewalStatus")
Parser
(Maybe [DomainValidationRecord]
-> Maybe POSIX -> Maybe Text -> RenewalSummary)
-> Parser (Maybe [DomainValidationRecord])
-> Parser (Maybe POSIX -> Maybe Text -> RenewalSummary)
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 POSIX -> Maybe Text -> RenewalSummary)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> RenewalSummary)
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
"updatedAt")
Parser (Maybe Text -> RenewalSummary)
-> Parser (Maybe Text) -> Parser RenewalSummary
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
"renewalStatusReason")
)
instance Prelude.Hashable RenewalSummary
instance Prelude.NFData RenewalSummary