{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $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 :: Lens' Reservation Text
reservation_currencyCode = 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 :: Lens' Reservation ReservationState
reservation_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 :: Lens' Reservation Text
reservation_offeringArn = 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 :: Lens' Reservation Text
reservation_reservationArn = 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 :: Lens' Reservation Text
reservation_start = 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 :: Lens' Reservation Text
reservation_offeringDescription = 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 :: Lens' Reservation Text
reservation_reservationName = 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 :: Lens' Reservation Text
reservation_end = 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 :: Lens' Reservation Int
reservation_duration = 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 :: Lens' Reservation DurationUnits
reservation_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 :: Lens' Reservation Text
reservation_pricePerUnit = 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 :: Lens' Reservation ResourceSpecification
reservation_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 :: Lens' Reservation PriceUnits
reservation_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 Data.FromJSON Reservation where
parseJSON :: Value -> Parser Reservation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Reservation"
( \Object
x ->
Text
-> ReservationState
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> Int
-> DurationUnits
-> Text
-> ResourceSpecification
-> PriceUnits
-> Reservation
Reservation'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"currencyCode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"reservationState")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"offeringArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"reservationArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"start")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"offeringDescription")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"reservationName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"end")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"duration")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"durationUnits")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"pricePerUnit")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"resourceSpecification")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"priceUnits")
)
instance Prelude.Hashable Reservation where
hashWithSalt :: Int -> Reservation -> Int
hashWithSalt Int
_salt Reservation' {Int
Text
DurationUnits
PriceUnits
ReservationState
ResourceSpecification
priceUnits :: PriceUnits
resourceSpecification :: ResourceSpecification
pricePerUnit :: Text
durationUnits :: DurationUnits
duration :: Int
end :: Text
reservationName :: Text
offeringDescription :: Text
start :: Text
reservationArn :: Text
offeringArn :: Text
reservationState :: ReservationState
currencyCode :: Text
$sel:priceUnits:Reservation' :: Reservation -> PriceUnits
$sel:resourceSpecification:Reservation' :: Reservation -> ResourceSpecification
$sel:pricePerUnit:Reservation' :: Reservation -> Text
$sel:durationUnits:Reservation' :: Reservation -> DurationUnits
$sel:duration:Reservation' :: Reservation -> Int
$sel:end:Reservation' :: Reservation -> Text
$sel:reservationName:Reservation' :: Reservation -> Text
$sel:offeringDescription:Reservation' :: Reservation -> Text
$sel:start:Reservation' :: Reservation -> Text
$sel:reservationArn:Reservation' :: Reservation -> Text
$sel:offeringArn:Reservation' :: Reservation -> Text
$sel:reservationState:Reservation' :: Reservation -> ReservationState
$sel:currencyCode:Reservation' :: Reservation -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
currencyCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ReservationState
reservationState
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
offeringArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
reservationArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
start
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
offeringDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
reservationName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
end
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
duration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DurationUnits
durationUnits
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
pricePerUnit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResourceSpecification
resourceSpecification
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PriceUnits
priceUnits
instance Prelude.NFData Reservation where
rnf :: Reservation -> ()
rnf Reservation' {Int
Text
DurationUnits
PriceUnits
ReservationState
ResourceSpecification
priceUnits :: PriceUnits
resourceSpecification :: ResourceSpecification
pricePerUnit :: Text
durationUnits :: DurationUnits
duration :: Int
end :: Text
reservationName :: Text
offeringDescription :: Text
start :: Text
reservationArn :: Text
offeringArn :: Text
reservationState :: ReservationState
currencyCode :: Text
$sel:priceUnits:Reservation' :: Reservation -> PriceUnits
$sel:resourceSpecification:Reservation' :: Reservation -> ResourceSpecification
$sel:pricePerUnit:Reservation' :: Reservation -> Text
$sel:durationUnits:Reservation' :: Reservation -> DurationUnits
$sel:duration:Reservation' :: Reservation -> Int
$sel:end:Reservation' :: Reservation -> Text
$sel:reservationName:Reservation' :: Reservation -> Text
$sel:offeringDescription:Reservation' :: Reservation -> Text
$sel:start:Reservation' :: Reservation -> Text
$sel:reservationArn:Reservation' :: Reservation -> Text
$sel:offeringArn:Reservation' :: Reservation -> Text
$sel:reservationState:Reservation' :: Reservation -> ReservationState
$sel:currencyCode:Reservation' :: Reservation -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
currencyCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ReservationState
reservationState
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
offeringArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
reservationArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
start
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
offeringDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
reservationName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
end
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
duration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DurationUnits
durationUnits
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
pricePerUnit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ResourceSpecification
resourceSpecification
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PriceUnits
priceUnits