{-# 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.ReservationPlanSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.Commitment
import Amazonka.MediaConvert.Types.RenewalType
import qualified Amazonka.Prelude as Prelude
data ReservationPlanSettings = ReservationPlanSettings'
{
ReservationPlanSettings -> Commitment
commitment :: Commitment,
ReservationPlanSettings -> Int
reservedSlots :: Prelude.Int,
ReservationPlanSettings -> RenewalType
renewalType :: RenewalType
}
deriving (ReservationPlanSettings -> ReservationPlanSettings -> Bool
(ReservationPlanSettings -> ReservationPlanSettings -> Bool)
-> (ReservationPlanSettings -> ReservationPlanSettings -> Bool)
-> Eq ReservationPlanSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReservationPlanSettings -> ReservationPlanSettings -> Bool
$c/= :: ReservationPlanSettings -> ReservationPlanSettings -> Bool
== :: ReservationPlanSettings -> ReservationPlanSettings -> Bool
$c== :: ReservationPlanSettings -> ReservationPlanSettings -> Bool
Prelude.Eq, ReadPrec [ReservationPlanSettings]
ReadPrec ReservationPlanSettings
Int -> ReadS ReservationPlanSettings
ReadS [ReservationPlanSettings]
(Int -> ReadS ReservationPlanSettings)
-> ReadS [ReservationPlanSettings]
-> ReadPrec ReservationPlanSettings
-> ReadPrec [ReservationPlanSettings]
-> Read ReservationPlanSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReservationPlanSettings]
$creadListPrec :: ReadPrec [ReservationPlanSettings]
readPrec :: ReadPrec ReservationPlanSettings
$creadPrec :: ReadPrec ReservationPlanSettings
readList :: ReadS [ReservationPlanSettings]
$creadList :: ReadS [ReservationPlanSettings]
readsPrec :: Int -> ReadS ReservationPlanSettings
$creadsPrec :: Int -> ReadS ReservationPlanSettings
Prelude.Read, Int -> ReservationPlanSettings -> ShowS
[ReservationPlanSettings] -> ShowS
ReservationPlanSettings -> String
(Int -> ReservationPlanSettings -> ShowS)
-> (ReservationPlanSettings -> String)
-> ([ReservationPlanSettings] -> ShowS)
-> Show ReservationPlanSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReservationPlanSettings] -> ShowS
$cshowList :: [ReservationPlanSettings] -> ShowS
show :: ReservationPlanSettings -> String
$cshow :: ReservationPlanSettings -> String
showsPrec :: Int -> ReservationPlanSettings -> ShowS
$cshowsPrec :: Int -> ReservationPlanSettings -> ShowS
Prelude.Show, (forall x.
ReservationPlanSettings -> Rep ReservationPlanSettings x)
-> (forall x.
Rep ReservationPlanSettings x -> ReservationPlanSettings)
-> Generic ReservationPlanSettings
forall x. Rep ReservationPlanSettings x -> ReservationPlanSettings
forall x. ReservationPlanSettings -> Rep ReservationPlanSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReservationPlanSettings x -> ReservationPlanSettings
$cfrom :: forall x. ReservationPlanSettings -> Rep ReservationPlanSettings x
Prelude.Generic)
newReservationPlanSettings ::
Commitment ->
Prelude.Int ->
RenewalType ->
ReservationPlanSettings
newReservationPlanSettings :: Commitment -> Int -> RenewalType -> ReservationPlanSettings
newReservationPlanSettings
Commitment
pCommitment_
Int
pReservedSlots_
RenewalType
pRenewalType_ =
ReservationPlanSettings' :: Commitment -> Int -> RenewalType -> ReservationPlanSettings
ReservationPlanSettings'
{ $sel:commitment:ReservationPlanSettings' :: Commitment
commitment = Commitment
pCommitment_,
$sel:reservedSlots:ReservationPlanSettings' :: Int
reservedSlots = Int
pReservedSlots_,
$sel:renewalType:ReservationPlanSettings' :: RenewalType
renewalType = RenewalType
pRenewalType_
}
reservationPlanSettings_commitment :: Lens.Lens' ReservationPlanSettings Commitment
reservationPlanSettings_commitment :: (Commitment -> f Commitment)
-> ReservationPlanSettings -> f ReservationPlanSettings
reservationPlanSettings_commitment = (ReservationPlanSettings -> Commitment)
-> (ReservationPlanSettings
-> Commitment -> ReservationPlanSettings)
-> Lens
ReservationPlanSettings
ReservationPlanSettings
Commitment
Commitment
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPlanSettings' {Commitment
commitment :: Commitment
$sel:commitment:ReservationPlanSettings' :: ReservationPlanSettings -> Commitment
commitment} -> Commitment
commitment) (\s :: ReservationPlanSettings
s@ReservationPlanSettings' {} Commitment
a -> ReservationPlanSettings
s {$sel:commitment:ReservationPlanSettings' :: Commitment
commitment = Commitment
a} :: ReservationPlanSettings)
reservationPlanSettings_reservedSlots :: Lens.Lens' ReservationPlanSettings Prelude.Int
reservationPlanSettings_reservedSlots :: (Int -> f Int)
-> ReservationPlanSettings -> f ReservationPlanSettings
reservationPlanSettings_reservedSlots = (ReservationPlanSettings -> Int)
-> (ReservationPlanSettings -> Int -> ReservationPlanSettings)
-> Lens ReservationPlanSettings ReservationPlanSettings Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPlanSettings' {Int
reservedSlots :: Int
$sel:reservedSlots:ReservationPlanSettings' :: ReservationPlanSettings -> Int
reservedSlots} -> Int
reservedSlots) (\s :: ReservationPlanSettings
s@ReservationPlanSettings' {} Int
a -> ReservationPlanSettings
s {$sel:reservedSlots:ReservationPlanSettings' :: Int
reservedSlots = Int
a} :: ReservationPlanSettings)
reservationPlanSettings_renewalType :: Lens.Lens' ReservationPlanSettings RenewalType
reservationPlanSettings_renewalType :: (RenewalType -> f RenewalType)
-> ReservationPlanSettings -> f ReservationPlanSettings
reservationPlanSettings_renewalType = (ReservationPlanSettings -> RenewalType)
-> (ReservationPlanSettings
-> RenewalType -> ReservationPlanSettings)
-> Lens
ReservationPlanSettings
ReservationPlanSettings
RenewalType
RenewalType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPlanSettings' {RenewalType
renewalType :: RenewalType
$sel:renewalType:ReservationPlanSettings' :: ReservationPlanSettings -> RenewalType
renewalType} -> RenewalType
renewalType) (\s :: ReservationPlanSettings
s@ReservationPlanSettings' {} RenewalType
a -> ReservationPlanSettings
s {$sel:renewalType:ReservationPlanSettings' :: RenewalType
renewalType = RenewalType
a} :: ReservationPlanSettings)
instance Prelude.Hashable ReservationPlanSettings
instance Prelude.NFData ReservationPlanSettings
instance Core.ToJSON ReservationPlanSettings where
toJSON :: ReservationPlanSettings -> Value
toJSON ReservationPlanSettings' {Int
Commitment
RenewalType
renewalType :: RenewalType
reservedSlots :: Int
commitment :: Commitment
$sel:renewalType:ReservationPlanSettings' :: ReservationPlanSettings -> RenewalType
$sel:reservedSlots:ReservationPlanSettings' :: ReservationPlanSettings -> Int
$sel:commitment:ReservationPlanSettings' :: ReservationPlanSettings -> Commitment
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"commitment" Text -> Commitment -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Commitment
commitment),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"reservedSlots" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
reservedSlots),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"renewalType" Text -> RenewalType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RenewalType
renewalType)
]
)