{-# 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.Shield.Types.Subscription where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Shield.Types.AutoRenew
import Amazonka.Shield.Types.Limit
import Amazonka.Shield.Types.ProactiveEngagementStatus
import Amazonka.Shield.Types.SubscriptionLimits
data Subscription = Subscription'
{
Subscription -> Maybe Natural
timeCommitmentInSeconds :: Prelude.Maybe Prelude.Natural,
Subscription -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
Subscription -> Maybe [Limit]
limits :: Prelude.Maybe [Limit],
Subscription -> Maybe AutoRenew
autoRenew :: Prelude.Maybe AutoRenew,
Subscription -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
Subscription -> Maybe ProactiveEngagementStatus
proactiveEngagementStatus :: Prelude.Maybe ProactiveEngagementStatus,
Subscription -> Maybe Text
subscriptionArn :: Prelude.Maybe Prelude.Text,
Subscription -> SubscriptionLimits
subscriptionLimits :: SubscriptionLimits
}
deriving (Subscription -> Subscription -> Bool
(Subscription -> Subscription -> Bool)
-> (Subscription -> Subscription -> Bool) -> Eq Subscription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Subscription -> Subscription -> Bool
$c/= :: Subscription -> Subscription -> Bool
== :: Subscription -> Subscription -> Bool
$c== :: Subscription -> Subscription -> Bool
Prelude.Eq, ReadPrec [Subscription]
ReadPrec Subscription
Int -> ReadS Subscription
ReadS [Subscription]
(Int -> ReadS Subscription)
-> ReadS [Subscription]
-> ReadPrec Subscription
-> ReadPrec [Subscription]
-> Read Subscription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Subscription]
$creadListPrec :: ReadPrec [Subscription]
readPrec :: ReadPrec Subscription
$creadPrec :: ReadPrec Subscription
readList :: ReadS [Subscription]
$creadList :: ReadS [Subscription]
readsPrec :: Int -> ReadS Subscription
$creadsPrec :: Int -> ReadS Subscription
Prelude.Read, Int -> Subscription -> ShowS
[Subscription] -> ShowS
Subscription -> String
(Int -> Subscription -> ShowS)
-> (Subscription -> String)
-> ([Subscription] -> ShowS)
-> Show Subscription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Subscription] -> ShowS
$cshowList :: [Subscription] -> ShowS
show :: Subscription -> String
$cshow :: Subscription -> String
showsPrec :: Int -> Subscription -> ShowS
$cshowsPrec :: Int -> Subscription -> ShowS
Prelude.Show, (forall x. Subscription -> Rep Subscription x)
-> (forall x. Rep Subscription x -> Subscription)
-> Generic Subscription
forall x. Rep Subscription x -> Subscription
forall x. Subscription -> Rep Subscription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Subscription x -> Subscription
$cfrom :: forall x. Subscription -> Rep Subscription x
Prelude.Generic)
newSubscription ::
SubscriptionLimits ->
Subscription
newSubscription :: SubscriptionLimits -> Subscription
newSubscription SubscriptionLimits
pSubscriptionLimits_ =
Subscription' :: Maybe Natural
-> Maybe POSIX
-> Maybe [Limit]
-> Maybe AutoRenew
-> Maybe POSIX
-> Maybe ProactiveEngagementStatus
-> Maybe Text
-> SubscriptionLimits
-> Subscription
Subscription'
{ $sel:timeCommitmentInSeconds:Subscription' :: Maybe Natural
timeCommitmentInSeconds =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:startTime:Subscription' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:limits:Subscription' :: Maybe [Limit]
limits = Maybe [Limit]
forall a. Maybe a
Prelude.Nothing,
$sel:autoRenew:Subscription' :: Maybe AutoRenew
autoRenew = Maybe AutoRenew
forall a. Maybe a
Prelude.Nothing,
$sel:endTime:Subscription' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:proactiveEngagementStatus:Subscription' :: Maybe ProactiveEngagementStatus
proactiveEngagementStatus = Maybe ProactiveEngagementStatus
forall a. Maybe a
Prelude.Nothing,
$sel:subscriptionArn:Subscription' :: Maybe Text
subscriptionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:subscriptionLimits:Subscription' :: SubscriptionLimits
subscriptionLimits = SubscriptionLimits
pSubscriptionLimits_
}
subscription_timeCommitmentInSeconds :: Lens.Lens' Subscription (Prelude.Maybe Prelude.Natural)
subscription_timeCommitmentInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> Subscription -> f Subscription
subscription_timeCommitmentInSeconds = (Subscription -> Maybe Natural)
-> (Subscription -> Maybe Natural -> Subscription)
-> Lens Subscription Subscription (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Subscription' {Maybe Natural
timeCommitmentInSeconds :: Maybe Natural
$sel:timeCommitmentInSeconds:Subscription' :: Subscription -> Maybe Natural
timeCommitmentInSeconds} -> Maybe Natural
timeCommitmentInSeconds) (\s :: Subscription
s@Subscription' {} Maybe Natural
a -> Subscription
s {$sel:timeCommitmentInSeconds:Subscription' :: Maybe Natural
timeCommitmentInSeconds = Maybe Natural
a} :: Subscription)
subscription_startTime :: Lens.Lens' Subscription (Prelude.Maybe Prelude.UTCTime)
subscription_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> Subscription -> f Subscription
subscription_startTime = (Subscription -> Maybe POSIX)
-> (Subscription -> Maybe POSIX -> Subscription)
-> Lens Subscription Subscription (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Subscription' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:Subscription' :: Subscription -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: Subscription
s@Subscription' {} Maybe POSIX
a -> Subscription
s {$sel:startTime:Subscription' :: Maybe POSIX
startTime = Maybe POSIX
a} :: Subscription) ((Maybe POSIX -> f (Maybe POSIX))
-> Subscription -> f Subscription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Subscription
-> f Subscription
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
subscription_limits :: Lens.Lens' Subscription (Prelude.Maybe [Limit])
subscription_limits :: (Maybe [Limit] -> f (Maybe [Limit]))
-> Subscription -> f Subscription
subscription_limits = (Subscription -> Maybe [Limit])
-> (Subscription -> Maybe [Limit] -> Subscription)
-> Lens Subscription Subscription (Maybe [Limit]) (Maybe [Limit])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Subscription' {Maybe [Limit]
limits :: Maybe [Limit]
$sel:limits:Subscription' :: Subscription -> Maybe [Limit]
limits} -> Maybe [Limit]
limits) (\s :: Subscription
s@Subscription' {} Maybe [Limit]
a -> Subscription
s {$sel:limits:Subscription' :: Maybe [Limit]
limits = Maybe [Limit]
a} :: Subscription) ((Maybe [Limit] -> f (Maybe [Limit]))
-> Subscription -> f Subscription)
-> ((Maybe [Limit] -> f (Maybe [Limit]))
-> Maybe [Limit] -> f (Maybe [Limit]))
-> (Maybe [Limit] -> f (Maybe [Limit]))
-> Subscription
-> f Subscription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Limit] [Limit] [Limit] [Limit]
-> Iso
(Maybe [Limit]) (Maybe [Limit]) (Maybe [Limit]) (Maybe [Limit])
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 [Limit] [Limit] [Limit] [Limit]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
subscription_autoRenew :: Lens.Lens' Subscription (Prelude.Maybe AutoRenew)
subscription_autoRenew :: (Maybe AutoRenew -> f (Maybe AutoRenew))
-> Subscription -> f Subscription
subscription_autoRenew = (Subscription -> Maybe AutoRenew)
-> (Subscription -> Maybe AutoRenew -> Subscription)
-> Lens
Subscription Subscription (Maybe AutoRenew) (Maybe AutoRenew)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Subscription' {Maybe AutoRenew
autoRenew :: Maybe AutoRenew
$sel:autoRenew:Subscription' :: Subscription -> Maybe AutoRenew
autoRenew} -> Maybe AutoRenew
autoRenew) (\s :: Subscription
s@Subscription' {} Maybe AutoRenew
a -> Subscription
s {$sel:autoRenew:Subscription' :: Maybe AutoRenew
autoRenew = Maybe AutoRenew
a} :: Subscription)
subscription_endTime :: Lens.Lens' Subscription (Prelude.Maybe Prelude.UTCTime)
subscription_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> Subscription -> f Subscription
subscription_endTime = (Subscription -> Maybe POSIX)
-> (Subscription -> Maybe POSIX -> Subscription)
-> Lens Subscription Subscription (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Subscription' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:Subscription' :: Subscription -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: Subscription
s@Subscription' {} Maybe POSIX
a -> Subscription
s {$sel:endTime:Subscription' :: Maybe POSIX
endTime = Maybe POSIX
a} :: Subscription) ((Maybe POSIX -> f (Maybe POSIX))
-> Subscription -> f Subscription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Subscription
-> f Subscription
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
subscription_proactiveEngagementStatus :: Lens.Lens' Subscription (Prelude.Maybe ProactiveEngagementStatus)
subscription_proactiveEngagementStatus :: (Maybe ProactiveEngagementStatus
-> f (Maybe ProactiveEngagementStatus))
-> Subscription -> f Subscription
subscription_proactiveEngagementStatus = (Subscription -> Maybe ProactiveEngagementStatus)
-> (Subscription
-> Maybe ProactiveEngagementStatus -> Subscription)
-> Lens
Subscription
Subscription
(Maybe ProactiveEngagementStatus)
(Maybe ProactiveEngagementStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Subscription' {Maybe ProactiveEngagementStatus
proactiveEngagementStatus :: Maybe ProactiveEngagementStatus
$sel:proactiveEngagementStatus:Subscription' :: Subscription -> Maybe ProactiveEngagementStatus
proactiveEngagementStatus} -> Maybe ProactiveEngagementStatus
proactiveEngagementStatus) (\s :: Subscription
s@Subscription' {} Maybe ProactiveEngagementStatus
a -> Subscription
s {$sel:proactiveEngagementStatus:Subscription' :: Maybe ProactiveEngagementStatus
proactiveEngagementStatus = Maybe ProactiveEngagementStatus
a} :: Subscription)
subscription_subscriptionArn :: Lens.Lens' Subscription (Prelude.Maybe Prelude.Text)
subscription_subscriptionArn :: (Maybe Text -> f (Maybe Text)) -> Subscription -> f Subscription
subscription_subscriptionArn = (Subscription -> Maybe Text)
-> (Subscription -> Maybe Text -> Subscription)
-> Lens Subscription Subscription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Subscription' {Maybe Text
subscriptionArn :: Maybe Text
$sel:subscriptionArn:Subscription' :: Subscription -> Maybe Text
subscriptionArn} -> Maybe Text
subscriptionArn) (\s :: Subscription
s@Subscription' {} Maybe Text
a -> Subscription
s {$sel:subscriptionArn:Subscription' :: Maybe Text
subscriptionArn = Maybe Text
a} :: Subscription)
subscription_subscriptionLimits :: Lens.Lens' Subscription SubscriptionLimits
subscription_subscriptionLimits :: (SubscriptionLimits -> f SubscriptionLimits)
-> Subscription -> f Subscription
subscription_subscriptionLimits = (Subscription -> SubscriptionLimits)
-> (Subscription -> SubscriptionLimits -> Subscription)
-> Lens
Subscription Subscription SubscriptionLimits SubscriptionLimits
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Subscription' {SubscriptionLimits
subscriptionLimits :: SubscriptionLimits
$sel:subscriptionLimits:Subscription' :: Subscription -> SubscriptionLimits
subscriptionLimits} -> SubscriptionLimits
subscriptionLimits) (\s :: Subscription
s@Subscription' {} SubscriptionLimits
a -> Subscription
s {$sel:subscriptionLimits:Subscription' :: SubscriptionLimits
subscriptionLimits = SubscriptionLimits
a} :: Subscription)
instance Core.FromJSON Subscription where
parseJSON :: Value -> Parser Subscription
parseJSON =
String
-> (Object -> Parser Subscription) -> Value -> Parser Subscription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Subscription"
( \Object
x ->
Maybe Natural
-> Maybe POSIX
-> Maybe [Limit]
-> Maybe AutoRenew
-> Maybe POSIX
-> Maybe ProactiveEngagementStatus
-> Maybe Text
-> SubscriptionLimits
-> Subscription
Subscription'
(Maybe Natural
-> Maybe POSIX
-> Maybe [Limit]
-> Maybe AutoRenew
-> Maybe POSIX
-> Maybe ProactiveEngagementStatus
-> Maybe Text
-> SubscriptionLimits
-> Subscription)
-> Parser (Maybe Natural)
-> Parser
(Maybe POSIX
-> Maybe [Limit]
-> Maybe AutoRenew
-> Maybe POSIX
-> Maybe ProactiveEngagementStatus
-> Maybe Text
-> SubscriptionLimits
-> Subscription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TimeCommitmentInSeconds")
Parser
(Maybe POSIX
-> Maybe [Limit]
-> Maybe AutoRenew
-> Maybe POSIX
-> Maybe ProactiveEngagementStatus
-> Maybe Text
-> SubscriptionLimits
-> Subscription)
-> Parser (Maybe POSIX)
-> Parser
(Maybe [Limit]
-> Maybe AutoRenew
-> Maybe POSIX
-> Maybe ProactiveEngagementStatus
-> Maybe Text
-> SubscriptionLimits
-> Subscription)
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
"StartTime")
Parser
(Maybe [Limit]
-> Maybe AutoRenew
-> Maybe POSIX
-> Maybe ProactiveEngagementStatus
-> Maybe Text
-> SubscriptionLimits
-> Subscription)
-> Parser (Maybe [Limit])
-> Parser
(Maybe AutoRenew
-> Maybe POSIX
-> Maybe ProactiveEngagementStatus
-> Maybe Text
-> SubscriptionLimits
-> Subscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Limit]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Limits" Parser (Maybe (Maybe [Limit]))
-> Maybe [Limit] -> Parser (Maybe [Limit])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Limit]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe AutoRenew
-> Maybe POSIX
-> Maybe ProactiveEngagementStatus
-> Maybe Text
-> SubscriptionLimits
-> Subscription)
-> Parser (Maybe AutoRenew)
-> Parser
(Maybe POSIX
-> Maybe ProactiveEngagementStatus
-> Maybe Text
-> SubscriptionLimits
-> Subscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AutoRenew)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AutoRenew")
Parser
(Maybe POSIX
-> Maybe ProactiveEngagementStatus
-> Maybe Text
-> SubscriptionLimits
-> Subscription)
-> Parser (Maybe POSIX)
-> Parser
(Maybe ProactiveEngagementStatus
-> Maybe Text -> SubscriptionLimits -> Subscription)
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
"EndTime")
Parser
(Maybe ProactiveEngagementStatus
-> Maybe Text -> SubscriptionLimits -> Subscription)
-> Parser (Maybe ProactiveEngagementStatus)
-> Parser (Maybe Text -> SubscriptionLimits -> Subscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProactiveEngagementStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProactiveEngagementStatus")
Parser (Maybe Text -> SubscriptionLimits -> Subscription)
-> Parser (Maybe Text)
-> Parser (SubscriptionLimits -> Subscription)
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
"SubscriptionArn")
Parser (SubscriptionLimits -> Subscription)
-> Parser SubscriptionLimits -> Parser Subscription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser SubscriptionLimits
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SubscriptionLimits")
)
instance Prelude.Hashable Subscription
instance Prelude.NFData Subscription