{-# 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.Shield.Types.Subscription
-- 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.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

-- | Information about the Shield Advanced subscription for an account.
--
-- /See:/ 'newSubscription' smart constructor.
data Subscription = Subscription'
  { -- | The length, in seconds, of the Shield Advanced subscription for the
    -- account.
    Subscription -> Maybe Natural
timeCommitmentInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The start time of the subscription, in Unix time in seconds. For more
    -- information see
    -- <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp>.
    Subscription -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | Specifies how many protections of a given type you can create.
    Subscription -> Maybe [Limit]
limits :: Prelude.Maybe [Limit],
    -- | If @ENABLED@, the subscription will be automatically renewed at the end
    -- of the existing subscription period.
    --
    -- When you initally create a subscription, @AutoRenew@ is set to
    -- @ENABLED@. You can change this by submitting an @UpdateSubscription@
    -- request. If the @UpdateSubscription@ request does not included a value
    -- for @AutoRenew@, the existing value for @AutoRenew@ remains unchanged.
    Subscription -> Maybe AutoRenew
autoRenew :: Prelude.Maybe AutoRenew,
    -- | The date and time your subscription will end.
    Subscription -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
    -- | If @ENABLED@, the Shield Response Team (SRT) will use email and phone to
    -- notify contacts about escalations to the SRT and to initiate proactive
    -- customer support.
    --
    -- If @PENDING@, you have requested proactive engagement and the request is
    -- pending. The status changes to @ENABLED@ when your request is fully
    -- processed.
    --
    -- If @DISABLED@, the SRT will not proactively notify contacts about
    -- escalations or to initiate proactive customer support.
    Subscription -> Maybe ProactiveEngagementStatus
proactiveEngagementStatus :: Prelude.Maybe ProactiveEngagementStatus,
    -- | The ARN (Amazon Resource Name) of the subscription.
    Subscription -> Maybe Text
subscriptionArn :: Prelude.Maybe Prelude.Text,
    -- | Limits settings for your subscription.
    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)

-- |
-- Create a value of 'Subscription' 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:
--
-- 'timeCommitmentInSeconds', 'subscription_timeCommitmentInSeconds' - The length, in seconds, of the Shield Advanced subscription for the
-- account.
--
-- 'startTime', 'subscription_startTime' - The start time of the subscription, in Unix time in seconds. For more
-- information see
-- <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp>.
--
-- 'limits', 'subscription_limits' - Specifies how many protections of a given type you can create.
--
-- 'autoRenew', 'subscription_autoRenew' - If @ENABLED@, the subscription will be automatically renewed at the end
-- of the existing subscription period.
--
-- When you initally create a subscription, @AutoRenew@ is set to
-- @ENABLED@. You can change this by submitting an @UpdateSubscription@
-- request. If the @UpdateSubscription@ request does not included a value
-- for @AutoRenew@, the existing value for @AutoRenew@ remains unchanged.
--
-- 'endTime', 'subscription_endTime' - The date and time your subscription will end.
--
-- 'proactiveEngagementStatus', 'subscription_proactiveEngagementStatus' - If @ENABLED@, the Shield Response Team (SRT) will use email and phone to
-- notify contacts about escalations to the SRT and to initiate proactive
-- customer support.
--
-- If @PENDING@, you have requested proactive engagement and the request is
-- pending. The status changes to @ENABLED@ when your request is fully
-- processed.
--
-- If @DISABLED@, the SRT will not proactively notify contacts about
-- escalations or to initiate proactive customer support.
--
-- 'subscriptionArn', 'subscription_subscriptionArn' - The ARN (Amazon Resource Name) of the subscription.
--
-- 'subscriptionLimits', 'subscription_subscriptionLimits' - Limits settings for your subscription.
newSubscription ::
  -- | 'subscriptionLimits'
  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_
    }

-- | The length, in seconds, of the Shield Advanced subscription for the
-- account.
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)

-- | The start time of the subscription, in Unix time in seconds. For more
-- information see
-- <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp>.
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

-- | Specifies how many protections of a given type you can create.
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

-- | If @ENABLED@, the subscription will be automatically renewed at the end
-- of the existing subscription period.
--
-- When you initally create a subscription, @AutoRenew@ is set to
-- @ENABLED@. You can change this by submitting an @UpdateSubscription@
-- request. If the @UpdateSubscription@ request does not included a value
-- for @AutoRenew@, the existing value for @AutoRenew@ remains unchanged.
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)

-- | The date and time your subscription will end.
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

-- | If @ENABLED@, the Shield Response Team (SRT) will use email and phone to
-- notify contacts about escalations to the SRT and to initiate proactive
-- customer support.
--
-- If @PENDING@, you have requested proactive engagement and the request is
-- pending. The status changes to @ENABLED@ when your request is fully
-- processed.
--
-- If @DISABLED@, the SRT will not proactively notify contacts about
-- escalations or to initiate proactive customer support.
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)

-- | The ARN (Amazon Resource Name) of the 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)

-- | Limits settings for your 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