{-# 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.MediaConnect.Types.Reservation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.DurationUnits
import Amazonka.MediaConnect.Types.PriceUnits
import Amazonka.MediaConnect.Types.ReservationState
import Amazonka.MediaConnect.Types.ResourceSpecification
import qualified Amazonka.Prelude as Prelude
data Reservation = Reservation'
{
Reservation -> Text
currencyCode :: Prelude.Text,
Reservation -> ReservationState
reservationState :: ReservationState,
Reservation -> Text
offeringArn :: Prelude.Text,
Reservation -> Text
reservationArn :: Prelude.Text,
Reservation -> Text
start :: Prelude.Text,
Reservation -> Text
offeringDescription :: Prelude.Text,
Reservation -> Text
reservationName :: Prelude.Text,
Reservation -> Text
end :: Prelude.Text,
Reservation -> Int
duration :: Prelude.Int,
Reservation -> DurationUnits
durationUnits :: DurationUnits,
Reservation -> Text
pricePerUnit :: Prelude.Text,
Reservation -> ResourceSpecification
resourceSpecification :: ResourceSpecification,
Reservation -> PriceUnits
priceUnits :: PriceUnits
}
deriving (Reservation -> Reservation -> Bool
(Reservation -> Reservation -> Bool)
-> (Reservation -> Reservation -> Bool) -> Eq Reservation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Reservation -> Reservation -> Bool
$c/= :: Reservation -> Reservation -> Bool
== :: Reservation -> Reservation -> Bool
$c== :: Reservation -> Reservation -> Bool
Prelude.Eq, ReadPrec [Reservation]
ReadPrec Reservation
Int -> ReadS Reservation
ReadS [Reservation]
(Int -> ReadS Reservation)
-> ReadS [Reservation]
-> ReadPrec Reservation
-> ReadPrec [Reservation]
-> Read Reservation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Reservation]
$creadListPrec :: ReadPrec [Reservation]
readPrec :: ReadPrec Reservation
$creadPrec :: ReadPrec Reservation
readList :: ReadS [Reservation]
$creadList :: ReadS [Reservation]
readsPrec :: Int -> ReadS Reservation
$creadsPrec :: Int -> ReadS Reservation
Prelude.Read, Int -> Reservation -> ShowS
[Reservation] -> ShowS
Reservation -> String
(Int -> Reservation -> ShowS)
-> (Reservation -> String)
-> ([Reservation] -> ShowS)
-> Show Reservation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Reservation] -> ShowS
$cshowList :: [Reservation] -> ShowS
show :: Reservation -> String
$cshow :: Reservation -> String
showsPrec :: Int -> Reservation -> ShowS
$cshowsPrec :: Int -> Reservation -> ShowS
Prelude.Show, (forall x. Reservation -> Rep Reservation x)
-> (forall x. Rep Reservation x -> Reservation)
-> Generic Reservation
forall x. Rep Reservation x -> Reservation
forall x. Reservation -> Rep Reservation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Reservation x -> Reservation
$cfrom :: forall x. Reservation -> Rep Reservation x
Prelude.Generic)
newReservation ::
Prelude.Text ->
ReservationState ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Int ->
DurationUnits ->
Prelude.Text ->
ResourceSpecification ->
PriceUnits ->
Reservation
newReservation :: Text
-> ReservationState
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation
newReservation
Text
pCurrencyCode_
ReservationState
pReservationState_
Text
pOfferingArn_
Text
pReservationArn_
Text
pStart_
Text
pOfferingDescription_
Text
pReservationName_
Text
pEnd_
Int
pDuration_
DurationUnits
pDurationUnits_
Text
pPricePerUnit_
ResourceSpecification
pResourceSpecification_
PriceUnits
pPriceUnits_ =
Reservation' :: Text
-> ReservationState
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation
Reservation'
{ $sel:currencyCode:Reservation' :: Text
currencyCode = Text
pCurrencyCode_,
$sel:reservationState:Reservation' :: ReservationState
reservationState = ReservationState
pReservationState_,
$sel:offeringArn:Reservation' :: Text
offeringArn = Text
pOfferingArn_,
$sel:reservationArn:Reservation' :: Text
reservationArn = Text
pReservationArn_,
$sel:start:Reservation' :: Text
start = Text
pStart_,
$sel:offeringDescription:Reservation' :: Text
offeringDescription = Text
pOfferingDescription_,
$sel:reservationName:Reservation' :: Text
reservationName = Text
pReservationName_,
$sel:end:Reservation' :: Text
end = Text
pEnd_,
$sel:duration:Reservation' :: Int
duration = Int
pDuration_,
$sel:durationUnits:Reservation' :: DurationUnits
durationUnits = DurationUnits
pDurationUnits_,
$sel:pricePerUnit:Reservation' :: Text
pricePerUnit = Text
pPricePerUnit_,
$sel:resourceSpecification:Reservation' :: ResourceSpecification
resourceSpecification = ResourceSpecification
pResourceSpecification_,
$sel:priceUnits:Reservation' :: PriceUnits
priceUnits = PriceUnits
pPriceUnits_
}
reservation_currencyCode :: Lens.Lens' Reservation Prelude.Text
reservation_currencyCode :: (Text -> f Text) -> Reservation -> f Reservation
reservation_currencyCode = (Reservation -> Text)
-> (Reservation -> Text -> Reservation)
-> Lens Reservation Reservation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Text
currencyCode :: Text
$sel:currencyCode:Reservation' :: Reservation -> Text
currencyCode} -> Text
currencyCode) (\s :: Reservation
s@Reservation' {} Text
a -> Reservation
s {$sel:currencyCode:Reservation' :: Text
currencyCode = Text
a} :: Reservation)
reservation_reservationState :: Lens.Lens' Reservation ReservationState
reservation_reservationState :: (ReservationState -> f ReservationState)
-> Reservation -> f Reservation
reservation_reservationState = (Reservation -> ReservationState)
-> (Reservation -> ReservationState -> Reservation)
-> Lens Reservation Reservation ReservationState ReservationState
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {ReservationState
reservationState :: ReservationState
$sel:reservationState:Reservation' :: Reservation -> ReservationState
reservationState} -> ReservationState
reservationState) (\s :: Reservation
s@Reservation' {} ReservationState
a -> Reservation
s {$sel:reservationState:Reservation' :: ReservationState
reservationState = ReservationState
a} :: Reservation)
reservation_offeringArn :: Lens.Lens' Reservation Prelude.Text
reservation_offeringArn :: (Text -> f Text) -> Reservation -> f Reservation
reservation_offeringArn = (Reservation -> Text)
-> (Reservation -> Text -> Reservation)
-> Lens Reservation Reservation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Text
offeringArn :: Text
$sel:offeringArn:Reservation' :: Reservation -> Text
offeringArn} -> Text
offeringArn) (\s :: Reservation
s@Reservation' {} Text
a -> Reservation
s {$sel:offeringArn:Reservation' :: Text
offeringArn = Text
a} :: Reservation)
reservation_reservationArn :: Lens.Lens' Reservation Prelude.Text
reservation_reservationArn :: (Text -> f Text) -> Reservation -> f Reservation
reservation_reservationArn = (Reservation -> Text)
-> (Reservation -> Text -> Reservation)
-> Lens Reservation Reservation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Text
reservationArn :: Text
$sel:reservationArn:Reservation' :: Reservation -> Text
reservationArn} -> Text
reservationArn) (\s :: Reservation
s@Reservation' {} Text
a -> Reservation
s {$sel:reservationArn:Reservation' :: Text
reservationArn = Text
a} :: Reservation)
reservation_start :: Lens.Lens' Reservation Prelude.Text
reservation_start :: (Text -> f Text) -> Reservation -> f Reservation
reservation_start = (Reservation -> Text)
-> (Reservation -> Text -> Reservation)
-> Lens Reservation Reservation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Text
start :: Text
$sel:start:Reservation' :: Reservation -> Text
start} -> Text
start) (\s :: Reservation
s@Reservation' {} Text
a -> Reservation
s {$sel:start:Reservation' :: Text
start = Text
a} :: Reservation)
reservation_offeringDescription :: Lens.Lens' Reservation Prelude.Text
reservation_offeringDescription :: (Text -> f Text) -> Reservation -> f Reservation
reservation_offeringDescription = (Reservation -> Text)
-> (Reservation -> Text -> Reservation)
-> Lens Reservation Reservation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Text
offeringDescription :: Text
$sel:offeringDescription:Reservation' :: Reservation -> Text
offeringDescription} -> Text
offeringDescription) (\s :: Reservation
s@Reservation' {} Text
a -> Reservation
s {$sel:offeringDescription:Reservation' :: Text
offeringDescription = Text
a} :: Reservation)
reservation_reservationName :: Lens.Lens' Reservation Prelude.Text
reservation_reservationName :: (Text -> f Text) -> Reservation -> f Reservation
reservation_reservationName = (Reservation -> Text)
-> (Reservation -> Text -> Reservation)
-> Lens Reservation Reservation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Text
reservationName :: Text
$sel:reservationName:Reservation' :: Reservation -> Text
reservationName} -> Text
reservationName) (\s :: Reservation
s@Reservation' {} Text
a -> Reservation
s {$sel:reservationName:Reservation' :: Text
reservationName = Text
a} :: Reservation)
reservation_end :: Lens.Lens' Reservation Prelude.Text
reservation_end :: (Text -> f Text) -> Reservation -> f Reservation
reservation_end = (Reservation -> Text)
-> (Reservation -> Text -> Reservation)
-> Lens Reservation Reservation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Text
end :: Text
$sel:end:Reservation' :: Reservation -> Text
end} -> Text
end) (\s :: Reservation
s@Reservation' {} Text
a -> Reservation
s {$sel:end:Reservation' :: Text
end = Text
a} :: Reservation)
reservation_duration :: Lens.Lens' Reservation Prelude.Int
reservation_duration :: (Int -> f Int) -> Reservation -> f Reservation
reservation_duration = (Reservation -> Int)
-> (Reservation -> Int -> Reservation)
-> Lens Reservation Reservation Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Int
duration :: Int
$sel:duration:Reservation' :: Reservation -> Int
duration} -> Int
duration) (\s :: Reservation
s@Reservation' {} Int
a -> Reservation
s {$sel:duration:Reservation' :: Int
duration = Int
a} :: Reservation)
reservation_durationUnits :: Lens.Lens' Reservation DurationUnits
reservation_durationUnits :: (DurationUnits -> f DurationUnits) -> Reservation -> f Reservation
reservation_durationUnits = (Reservation -> DurationUnits)
-> (Reservation -> DurationUnits -> Reservation)
-> Lens Reservation Reservation DurationUnits DurationUnits
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {DurationUnits
durationUnits :: DurationUnits
$sel:durationUnits:Reservation' :: Reservation -> DurationUnits
durationUnits} -> DurationUnits
durationUnits) (\s :: Reservation
s@Reservation' {} DurationUnits
a -> Reservation
s {$sel:durationUnits:Reservation' :: DurationUnits
durationUnits = DurationUnits
a} :: Reservation)
reservation_pricePerUnit :: Lens.Lens' Reservation Prelude.Text
reservation_pricePerUnit :: (Text -> f Text) -> Reservation -> f Reservation
reservation_pricePerUnit = (Reservation -> Text)
-> (Reservation -> Text -> Reservation)
-> Lens Reservation Reservation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Text
pricePerUnit :: Text
$sel:pricePerUnit:Reservation' :: Reservation -> Text
pricePerUnit} -> Text
pricePerUnit) (\s :: Reservation
s@Reservation' {} Text
a -> Reservation
s {$sel:pricePerUnit:Reservation' :: Text
pricePerUnit = Text
a} :: Reservation)
reservation_resourceSpecification :: Lens.Lens' Reservation ResourceSpecification
reservation_resourceSpecification :: (ResourceSpecification -> f ResourceSpecification)
-> Reservation -> f Reservation
reservation_resourceSpecification = (Reservation -> ResourceSpecification)
-> (Reservation -> ResourceSpecification -> Reservation)
-> Lens
Reservation Reservation ResourceSpecification ResourceSpecification
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {ResourceSpecification
resourceSpecification :: ResourceSpecification
$sel:resourceSpecification:Reservation' :: Reservation -> ResourceSpecification
resourceSpecification} -> ResourceSpecification
resourceSpecification) (\s :: Reservation
s@Reservation' {} ResourceSpecification
a -> Reservation
s {$sel:resourceSpecification:Reservation' :: ResourceSpecification
resourceSpecification = ResourceSpecification
a} :: Reservation)
reservation_priceUnits :: Lens.Lens' Reservation PriceUnits
reservation_priceUnits :: (PriceUnits -> f PriceUnits) -> Reservation -> f Reservation
reservation_priceUnits = (Reservation -> PriceUnits)
-> (Reservation -> PriceUnits -> Reservation)
-> Lens Reservation Reservation PriceUnits PriceUnits
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {PriceUnits
priceUnits :: PriceUnits
$sel:priceUnits:Reservation' :: Reservation -> PriceUnits
priceUnits} -> PriceUnits
priceUnits) (\s :: Reservation
s@Reservation' {} PriceUnits
a -> Reservation
s {$sel:priceUnits:Reservation' :: PriceUnits
priceUnits = PriceUnits
a} :: Reservation)
instance Core.FromJSON Reservation where
parseJSON :: Value -> Parser Reservation
parseJSON =
String
-> (Object -> Parser Reservation) -> Value -> Parser Reservation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Reservation"
( \Object
x ->
Text
-> ReservationState
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation
Reservation'
(Text
-> ReservationState
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
-> Parser Text
-> Parser
(ReservationState
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"currencyCode")
Parser
(ReservationState
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
-> Parser ReservationState
-> Parser
(Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ReservationState
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"reservationState")
Parser
(Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
-> Parser Text
-> Parser
(Text
-> Text
-> Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"offeringArn")
Parser
(Text
-> Text
-> Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
-> Parser Text
-> Parser
(Text
-> Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"reservationArn")
Parser
(Text
-> Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
-> Parser Text
-> Parser
(Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"start")
Parser
(Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
-> Parser Text
-> Parser
(Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"offeringDescription")
Parser
(Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
-> Parser Text
-> Parser
(Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"reservationName")
Parser
(Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
-> Parser Text
-> Parser
(Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"end")
Parser
(Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation)
-> Parser Int
-> Parser
(DurationUnits
-> Text -> ResourceSpecification -> PriceUnits -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"duration")
Parser
(DurationUnits
-> Text -> ResourceSpecification -> PriceUnits -> Reservation)
-> Parser DurationUnits
-> Parser
(Text -> ResourceSpecification -> PriceUnits -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DurationUnits
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"durationUnits")
Parser (Text -> ResourceSpecification -> PriceUnits -> Reservation)
-> Parser Text
-> Parser (ResourceSpecification -> PriceUnits -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"pricePerUnit")
Parser (ResourceSpecification -> PriceUnits -> Reservation)
-> Parser ResourceSpecification
-> Parser (PriceUnits -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ResourceSpecification
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"resourceSpecification")
Parser (PriceUnits -> Reservation)
-> Parser PriceUnits -> Parser Reservation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser PriceUnits
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"priceUnits")
)
instance Prelude.Hashable Reservation
instance Prelude.NFData Reservation