{-# 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.MediaConnect.Types.Reservation
-- 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.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

-- | A pricing agreement for a discounted rate for a specific outbound
-- bandwidth that your MediaConnect account will use each month over a
-- specific time period. The discounted rate in the reservation applies to
-- outbound bandwidth for all flows from your account until your account
-- reaches the amount of bandwidth in your reservation. If you use more
-- outbound bandwidth than the agreed upon amount in a single month, the
-- overage is charged at the on-demand rate.
--
-- /See:/ 'newReservation' smart constructor.
data Reservation = Reservation'
  { -- | The type of currency that is used for billing. The currencyCode used for
    -- your reservation is US dollars.
    Reservation -> Text
currencyCode :: Prelude.Text,
    -- | The status of your reservation.
    Reservation -> ReservationState
reservationState :: ReservationState,
    -- | The Amazon Resource Name (ARN) that MediaConnect assigns to the
    -- offering.
    Reservation -> Text
offeringArn :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) that MediaConnect assigns to the
    -- reservation when you purchase an offering.
    Reservation -> Text
reservationArn :: Prelude.Text,
    -- | The day and time that the reservation becomes active. You set this value
    -- when you purchase the offering.
    Reservation -> Text
start :: Prelude.Text,
    -- | A description of the offering. MediaConnect defines this value in the
    -- offering.
    Reservation -> Text
offeringDescription :: Prelude.Text,
    -- | The name that you assigned to the reservation when you purchased the
    -- offering.
    Reservation -> Text
reservationName :: Prelude.Text,
    -- | The day and time that this reservation expires. This value is calculated
    -- based on the start date and time that you set and the offering\'s
    -- duration.
    Reservation -> Text
end :: Prelude.Text,
    -- | The length of time that this reservation is active. MediaConnect defines
    -- this value in the offering.
    Reservation -> Int
duration :: Prelude.Int,
    -- | The unit of measurement for the duration of the reservation.
    -- MediaConnect defines this value in the offering.
    Reservation -> DurationUnits
durationUnits :: DurationUnits,
    -- | The cost of a single unit. This value, in combination with priceUnits,
    -- makes up the rate. MediaConnect defines this value in the offering.
    Reservation -> Text
pricePerUnit :: Prelude.Text,
    -- | A definition of the amount of outbound bandwidth that you would be
    -- reserving if you purchase the offering. MediaConnect defines the values
    -- that make up the resourceSpecification in the offering.
    Reservation -> ResourceSpecification
resourceSpecification :: ResourceSpecification,
    -- | The unit of measurement that is used for billing. This value, in
    -- combination with pricePerUnit, makes up the rate. MediaConnect defines
    -- this value in the offering.
    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)

-- |
-- Create a value of 'Reservation' 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:
--
-- 'currencyCode', 'reservation_currencyCode' - The type of currency that is used for billing. The currencyCode used for
-- your reservation is US dollars.
--
-- 'reservationState', 'reservation_reservationState' - The status of your reservation.
--
-- 'offeringArn', 'reservation_offeringArn' - The Amazon Resource Name (ARN) that MediaConnect assigns to the
-- offering.
--
-- 'reservationArn', 'reservation_reservationArn' - The Amazon Resource Name (ARN) that MediaConnect assigns to the
-- reservation when you purchase an offering.
--
-- 'start', 'reservation_start' - The day and time that the reservation becomes active. You set this value
-- when you purchase the offering.
--
-- 'offeringDescription', 'reservation_offeringDescription' - A description of the offering. MediaConnect defines this value in the
-- offering.
--
-- 'reservationName', 'reservation_reservationName' - The name that you assigned to the reservation when you purchased the
-- offering.
--
-- 'end', 'reservation_end' - The day and time that this reservation expires. This value is calculated
-- based on the start date and time that you set and the offering\'s
-- duration.
--
-- 'duration', 'reservation_duration' - The length of time that this reservation is active. MediaConnect defines
-- this value in the offering.
--
-- 'durationUnits', 'reservation_durationUnits' - The unit of measurement for the duration of the reservation.
-- MediaConnect defines this value in the offering.
--
-- 'pricePerUnit', 'reservation_pricePerUnit' - The cost of a single unit. This value, in combination with priceUnits,
-- makes up the rate. MediaConnect defines this value in the offering.
--
-- 'resourceSpecification', 'reservation_resourceSpecification' - A definition of the amount of outbound bandwidth that you would be
-- reserving if you purchase the offering. MediaConnect defines the values
-- that make up the resourceSpecification in the offering.
--
-- 'priceUnits', 'reservation_priceUnits' - The unit of measurement that is used for billing. This value, in
-- combination with pricePerUnit, makes up the rate. MediaConnect defines
-- this value in the offering.
newReservation ::
  -- | 'currencyCode'
  Prelude.Text ->
  -- | 'reservationState'
  ReservationState ->
  -- | 'offeringArn'
  Prelude.Text ->
  -- | 'reservationArn'
  Prelude.Text ->
  -- | 'start'
  Prelude.Text ->
  -- | 'offeringDescription'
  Prelude.Text ->
  -- | 'reservationName'
  Prelude.Text ->
  -- | 'end'
  Prelude.Text ->
  -- | 'duration'
  Prelude.Int ->
  -- | 'durationUnits'
  DurationUnits ->
  -- | 'pricePerUnit'
  Prelude.Text ->
  -- | 'resourceSpecification'
  ResourceSpecification ->
  -- | 'priceUnits'
  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_
      }

-- | The type of currency that is used for billing. The currencyCode used for
-- your reservation is US dollars.
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)

-- | The status of your 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)

-- | The Amazon Resource Name (ARN) that MediaConnect assigns to the
-- offering.
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)

-- | The Amazon Resource Name (ARN) that MediaConnect assigns to the
-- reservation when you purchase an offering.
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)

-- | The day and time that the reservation becomes active. You set this value
-- when you purchase the offering.
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)

-- | A description of the offering. MediaConnect defines this value in the
-- offering.
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)

-- | The name that you assigned to the reservation when you purchased the
-- offering.
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)

-- | The day and time that this reservation expires. This value is calculated
-- based on the start date and time that you set and the offering\'s
-- duration.
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)

-- | The length of time that this reservation is active. MediaConnect defines
-- this value in the offering.
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)

-- | The unit of measurement for the duration of the reservation.
-- MediaConnect defines this value in the offering.
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)

-- | The cost of a single unit. This value, in combination with priceUnits,
-- makes up the rate. MediaConnect defines this value in the offering.
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)

-- | A definition of the amount of outbound bandwidth that you would be
-- reserving if you purchase the offering. MediaConnect defines the values
-- that make up the resourceSpecification in the offering.
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)

-- | The unit of measurement that is used for billing. This value, in
-- combination with pricePerUnit, makes up the rate. MediaConnect defines
-- this value in the offering.
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