{-# 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.MediaConvert.Types.ReservationPlan where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.Commitment
import Amazonka.MediaConvert.Types.RenewalType
import Amazonka.MediaConvert.Types.ReservationPlanStatus
import qualified Amazonka.Prelude as Prelude
data ReservationPlan = ReservationPlan'
{
ReservationPlan -> Maybe ReservationPlanStatus
status :: Prelude.Maybe ReservationPlanStatus,
ReservationPlan -> Maybe POSIX
expiresAt :: Prelude.Maybe Core.POSIX,
ReservationPlan -> Maybe POSIX
purchasedAt :: Prelude.Maybe Core.POSIX,
ReservationPlan -> Maybe Commitment
commitment :: Prelude.Maybe Commitment,
ReservationPlan -> Maybe Int
reservedSlots :: Prelude.Maybe Prelude.Int,
ReservationPlan -> Maybe RenewalType
renewalType :: Prelude.Maybe RenewalType
}
deriving (ReservationPlan -> ReservationPlan -> Bool
(ReservationPlan -> ReservationPlan -> Bool)
-> (ReservationPlan -> ReservationPlan -> Bool)
-> Eq ReservationPlan
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReservationPlan -> ReservationPlan -> Bool
$c/= :: ReservationPlan -> ReservationPlan -> Bool
== :: ReservationPlan -> ReservationPlan -> Bool
$c== :: ReservationPlan -> ReservationPlan -> Bool
Prelude.Eq, ReadPrec [ReservationPlan]
ReadPrec ReservationPlan
Int -> ReadS ReservationPlan
ReadS [ReservationPlan]
(Int -> ReadS ReservationPlan)
-> ReadS [ReservationPlan]
-> ReadPrec ReservationPlan
-> ReadPrec [ReservationPlan]
-> Read ReservationPlan
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReservationPlan]
$creadListPrec :: ReadPrec [ReservationPlan]
readPrec :: ReadPrec ReservationPlan
$creadPrec :: ReadPrec ReservationPlan
readList :: ReadS [ReservationPlan]
$creadList :: ReadS [ReservationPlan]
readsPrec :: Int -> ReadS ReservationPlan
$creadsPrec :: Int -> ReadS ReservationPlan
Prelude.Read, Int -> ReservationPlan -> ShowS
[ReservationPlan] -> ShowS
ReservationPlan -> String
(Int -> ReservationPlan -> ShowS)
-> (ReservationPlan -> String)
-> ([ReservationPlan] -> ShowS)
-> Show ReservationPlan
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReservationPlan] -> ShowS
$cshowList :: [ReservationPlan] -> ShowS
show :: ReservationPlan -> String
$cshow :: ReservationPlan -> String
showsPrec :: Int -> ReservationPlan -> ShowS
$cshowsPrec :: Int -> ReservationPlan -> ShowS
Prelude.Show, (forall x. ReservationPlan -> Rep ReservationPlan x)
-> (forall x. Rep ReservationPlan x -> ReservationPlan)
-> Generic ReservationPlan
forall x. Rep ReservationPlan x -> ReservationPlan
forall x. ReservationPlan -> Rep ReservationPlan x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReservationPlan x -> ReservationPlan
$cfrom :: forall x. ReservationPlan -> Rep ReservationPlan x
Prelude.Generic)
newReservationPlan ::
ReservationPlan
newReservationPlan :: ReservationPlan
newReservationPlan =
ReservationPlan' :: Maybe ReservationPlanStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Commitment
-> Maybe Int
-> Maybe RenewalType
-> ReservationPlan
ReservationPlan'
{ $sel:status:ReservationPlan' :: Maybe ReservationPlanStatus
status = Maybe ReservationPlanStatus
forall a. Maybe a
Prelude.Nothing,
$sel:expiresAt:ReservationPlan' :: Maybe POSIX
expiresAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:purchasedAt:ReservationPlan' :: Maybe POSIX
purchasedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:commitment:ReservationPlan' :: Maybe Commitment
commitment = Maybe Commitment
forall a. Maybe a
Prelude.Nothing,
$sel:reservedSlots:ReservationPlan' :: Maybe Int
reservedSlots = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:renewalType:ReservationPlan' :: Maybe RenewalType
renewalType = Maybe RenewalType
forall a. Maybe a
Prelude.Nothing
}
reservationPlan_status :: Lens.Lens' ReservationPlan (Prelude.Maybe ReservationPlanStatus)
reservationPlan_status :: (Maybe ReservationPlanStatus -> f (Maybe ReservationPlanStatus))
-> ReservationPlan -> f ReservationPlan
reservationPlan_status = (ReservationPlan -> Maybe ReservationPlanStatus)
-> (ReservationPlan
-> Maybe ReservationPlanStatus -> ReservationPlan)
-> Lens
ReservationPlan
ReservationPlan
(Maybe ReservationPlanStatus)
(Maybe ReservationPlanStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPlan' {Maybe ReservationPlanStatus
status :: Maybe ReservationPlanStatus
$sel:status:ReservationPlan' :: ReservationPlan -> Maybe ReservationPlanStatus
status} -> Maybe ReservationPlanStatus
status) (\s :: ReservationPlan
s@ReservationPlan' {} Maybe ReservationPlanStatus
a -> ReservationPlan
s {$sel:status:ReservationPlan' :: Maybe ReservationPlanStatus
status = Maybe ReservationPlanStatus
a} :: ReservationPlan)
reservationPlan_expiresAt :: Lens.Lens' ReservationPlan (Prelude.Maybe Prelude.UTCTime)
reservationPlan_expiresAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReservationPlan -> f ReservationPlan
reservationPlan_expiresAt = (ReservationPlan -> Maybe POSIX)
-> (ReservationPlan -> Maybe POSIX -> ReservationPlan)
-> Lens ReservationPlan ReservationPlan (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPlan' {Maybe POSIX
expiresAt :: Maybe POSIX
$sel:expiresAt:ReservationPlan' :: ReservationPlan -> Maybe POSIX
expiresAt} -> Maybe POSIX
expiresAt) (\s :: ReservationPlan
s@ReservationPlan' {} Maybe POSIX
a -> ReservationPlan
s {$sel:expiresAt:ReservationPlan' :: Maybe POSIX
expiresAt = Maybe POSIX
a} :: ReservationPlan) ((Maybe POSIX -> f (Maybe POSIX))
-> ReservationPlan -> f ReservationPlan)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReservationPlan
-> f ReservationPlan
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
reservationPlan_purchasedAt :: Lens.Lens' ReservationPlan (Prelude.Maybe Prelude.UTCTime)
reservationPlan_purchasedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReservationPlan -> f ReservationPlan
reservationPlan_purchasedAt = (ReservationPlan -> Maybe POSIX)
-> (ReservationPlan -> Maybe POSIX -> ReservationPlan)
-> Lens ReservationPlan ReservationPlan (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPlan' {Maybe POSIX
purchasedAt :: Maybe POSIX
$sel:purchasedAt:ReservationPlan' :: ReservationPlan -> Maybe POSIX
purchasedAt} -> Maybe POSIX
purchasedAt) (\s :: ReservationPlan
s@ReservationPlan' {} Maybe POSIX
a -> ReservationPlan
s {$sel:purchasedAt:ReservationPlan' :: Maybe POSIX
purchasedAt = Maybe POSIX
a} :: ReservationPlan) ((Maybe POSIX -> f (Maybe POSIX))
-> ReservationPlan -> f ReservationPlan)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReservationPlan
-> f ReservationPlan
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
reservationPlan_commitment :: Lens.Lens' ReservationPlan (Prelude.Maybe Commitment)
reservationPlan_commitment :: (Maybe Commitment -> f (Maybe Commitment))
-> ReservationPlan -> f ReservationPlan
reservationPlan_commitment = (ReservationPlan -> Maybe Commitment)
-> (ReservationPlan -> Maybe Commitment -> ReservationPlan)
-> Lens
ReservationPlan
ReservationPlan
(Maybe Commitment)
(Maybe Commitment)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPlan' {Maybe Commitment
commitment :: Maybe Commitment
$sel:commitment:ReservationPlan' :: ReservationPlan -> Maybe Commitment
commitment} -> Maybe Commitment
commitment) (\s :: ReservationPlan
s@ReservationPlan' {} Maybe Commitment
a -> ReservationPlan
s {$sel:commitment:ReservationPlan' :: Maybe Commitment
commitment = Maybe Commitment
a} :: ReservationPlan)
reservationPlan_reservedSlots :: Lens.Lens' ReservationPlan (Prelude.Maybe Prelude.Int)
reservationPlan_reservedSlots :: (Maybe Int -> f (Maybe Int))
-> ReservationPlan -> f ReservationPlan
reservationPlan_reservedSlots = (ReservationPlan -> Maybe Int)
-> (ReservationPlan -> Maybe Int -> ReservationPlan)
-> Lens ReservationPlan ReservationPlan (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPlan' {Maybe Int
reservedSlots :: Maybe Int
$sel:reservedSlots:ReservationPlan' :: ReservationPlan -> Maybe Int
reservedSlots} -> Maybe Int
reservedSlots) (\s :: ReservationPlan
s@ReservationPlan' {} Maybe Int
a -> ReservationPlan
s {$sel:reservedSlots:ReservationPlan' :: Maybe Int
reservedSlots = Maybe Int
a} :: ReservationPlan)
reservationPlan_renewalType :: Lens.Lens' ReservationPlan (Prelude.Maybe RenewalType)
reservationPlan_renewalType :: (Maybe RenewalType -> f (Maybe RenewalType))
-> ReservationPlan -> f ReservationPlan
reservationPlan_renewalType = (ReservationPlan -> Maybe RenewalType)
-> (ReservationPlan -> Maybe RenewalType -> ReservationPlan)
-> Lens
ReservationPlan
ReservationPlan
(Maybe RenewalType)
(Maybe RenewalType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPlan' {Maybe RenewalType
renewalType :: Maybe RenewalType
$sel:renewalType:ReservationPlan' :: ReservationPlan -> Maybe RenewalType
renewalType} -> Maybe RenewalType
renewalType) (\s :: ReservationPlan
s@ReservationPlan' {} Maybe RenewalType
a -> ReservationPlan
s {$sel:renewalType:ReservationPlan' :: Maybe RenewalType
renewalType = Maybe RenewalType
a} :: ReservationPlan)
instance Core.FromJSON ReservationPlan where
parseJSON :: Value -> Parser ReservationPlan
parseJSON =
String
-> (Object -> Parser ReservationPlan)
-> Value
-> Parser ReservationPlan
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ReservationPlan"
( \Object
x ->
Maybe ReservationPlanStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Commitment
-> Maybe Int
-> Maybe RenewalType
-> ReservationPlan
ReservationPlan'
(Maybe ReservationPlanStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Commitment
-> Maybe Int
-> Maybe RenewalType
-> ReservationPlan)
-> Parser (Maybe ReservationPlanStatus)
-> Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe Commitment
-> Maybe Int
-> Maybe RenewalType
-> ReservationPlan)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ReservationPlanStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe Commitment
-> Maybe Int
-> Maybe RenewalType
-> ReservationPlan)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe Commitment
-> Maybe Int
-> Maybe RenewalType
-> ReservationPlan)
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
"expiresAt")
Parser
(Maybe POSIX
-> Maybe Commitment
-> Maybe Int
-> Maybe RenewalType
-> ReservationPlan)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Commitment
-> Maybe Int -> Maybe RenewalType -> ReservationPlan)
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
"purchasedAt")
Parser
(Maybe Commitment
-> Maybe Int -> Maybe RenewalType -> ReservationPlan)
-> Parser (Maybe Commitment)
-> Parser (Maybe Int -> Maybe RenewalType -> ReservationPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Commitment)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"commitment")
Parser (Maybe Int -> Maybe RenewalType -> ReservationPlan)
-> Parser (Maybe Int)
-> Parser (Maybe RenewalType -> ReservationPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"reservedSlots")
Parser (Maybe RenewalType -> ReservationPlan)
-> Parser (Maybe RenewalType) -> Parser ReservationPlan
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RenewalType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"renewalType")
)
instance Prelude.Hashable ReservationPlan
instance Prelude.NFData ReservationPlan