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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.OfferingDurationUnits
import Amazonka.MediaLive.Types.OfferingType
import Amazonka.MediaLive.Types.ReservationResourceSpecification
import Amazonka.MediaLive.Types.ReservationState
import qualified Amazonka.Prelude as Prelude

-- | Reserved resources available to use
--
-- /See:/ 'newReservation' smart constructor.
data Reservation = Reservation'
  { -- | Current state of reservation, e.g. \'ACTIVE\'
    Reservation -> Maybe ReservationState
state :: Prelude.Maybe ReservationState,
    -- | Resource configuration details
    Reservation -> Maybe ReservationResourceSpecification
resourceSpecification :: Prelude.Maybe ReservationResourceSpecification,
    -- | Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g.
    -- \'USD\'
    Reservation -> Maybe Text
currencyCode :: Prelude.Maybe Prelude.Text,
    -- | Unique reservation ARN, e.g.
    -- \'arn:aws:medialive:us-west-2:123456789012:reservation:1234567\'
    Reservation -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Reservation UTC start date and time in ISO-8601 format, e.g.
    -- \'2018-03-01T00:00:00\'
    Reservation -> Maybe Text
start :: Prelude.Maybe Prelude.Text,
    -- | Number of reserved resources
    Reservation -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
    -- | Reservation UTC end date and time in ISO-8601 format, e.g.
    -- \'2019-03-01T00:00:00\'
    Reservation -> Maybe Text
end :: Prelude.Maybe Prelude.Text,
    -- | User specified reservation name
    Reservation -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Unique reservation ID, e.g. \'1234567\'
    Reservation -> Maybe Text
reservationId :: Prelude.Maybe Prelude.Text,
    -- | Unique offering ID, e.g. \'87654321\'
    Reservation -> Maybe Text
offeringId :: Prelude.Maybe Prelude.Text,
    -- | AWS region, e.g. \'us-west-2\'
    Reservation -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | Offering type, e.g. \'NO_UPFRONT\'
    Reservation -> Maybe OfferingType
offeringType :: Prelude.Maybe OfferingType,
    -- | Recurring usage charge for each reserved resource, e.g. \'157.0\'
    Reservation -> Maybe Double
usagePrice :: Prelude.Maybe Prelude.Double,
    -- | One-time charge for each reserved resource, e.g. \'0.0\' for a
    -- NO_UPFRONT offering
    Reservation -> Maybe Double
fixedPrice :: Prelude.Maybe Prelude.Double,
    -- | Units for duration, e.g. \'MONTHS\'
    Reservation -> Maybe OfferingDurationUnits
durationUnits :: Prelude.Maybe OfferingDurationUnits,
    -- | Offering description, e.g. \'HD AVC output at 10-20 Mbps, 30 fps, and
    -- standard VQ in US West (Oregon)\'
    Reservation -> Maybe Text
offeringDescription :: Prelude.Maybe Prelude.Text,
    -- | Lease duration, e.g. \'12\'
    Reservation -> Maybe Int
duration :: Prelude.Maybe Prelude.Int,
    -- | A collection of key-value pairs
    Reservation -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  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:
--
-- 'state', 'reservation_state' - Current state of reservation, e.g. \'ACTIVE\'
--
-- 'resourceSpecification', 'reservation_resourceSpecification' - Resource configuration details
--
-- 'currencyCode', 'reservation_currencyCode' - Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g.
-- \'USD\'
--
-- 'arn', 'reservation_arn' - Unique reservation ARN, e.g.
-- \'arn:aws:medialive:us-west-2:123456789012:reservation:1234567\'
--
-- 'start', 'reservation_start' - Reservation UTC start date and time in ISO-8601 format, e.g.
-- \'2018-03-01T00:00:00\'
--
-- 'count', 'reservation_count' - Number of reserved resources
--
-- 'end', 'reservation_end' - Reservation UTC end date and time in ISO-8601 format, e.g.
-- \'2019-03-01T00:00:00\'
--
-- 'name', 'reservation_name' - User specified reservation name
--
-- 'reservationId', 'reservation_reservationId' - Unique reservation ID, e.g. \'1234567\'
--
-- 'offeringId', 'reservation_offeringId' - Unique offering ID, e.g. \'87654321\'
--
-- 'region', 'reservation_region' - AWS region, e.g. \'us-west-2\'
--
-- 'offeringType', 'reservation_offeringType' - Offering type, e.g. \'NO_UPFRONT\'
--
-- 'usagePrice', 'reservation_usagePrice' - Recurring usage charge for each reserved resource, e.g. \'157.0\'
--
-- 'fixedPrice', 'reservation_fixedPrice' - One-time charge for each reserved resource, e.g. \'0.0\' for a
-- NO_UPFRONT offering
--
-- 'durationUnits', 'reservation_durationUnits' - Units for duration, e.g. \'MONTHS\'
--
-- 'offeringDescription', 'reservation_offeringDescription' - Offering description, e.g. \'HD AVC output at 10-20 Mbps, 30 fps, and
-- standard VQ in US West (Oregon)\'
--
-- 'duration', 'reservation_duration' - Lease duration, e.g. \'12\'
--
-- 'tags', 'reservation_tags' - A collection of key-value pairs
newReservation ::
  Reservation
newReservation :: Reservation
newReservation =
  Reservation' :: Maybe ReservationState
-> Maybe ReservationResourceSpecification
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe OfferingType
-> Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Maybe (HashMap Text Text)
-> Reservation
Reservation'
    { $sel:state:Reservation' :: Maybe ReservationState
state = Maybe ReservationState
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceSpecification:Reservation' :: Maybe ReservationResourceSpecification
resourceSpecification = Maybe ReservationResourceSpecification
forall a. Maybe a
Prelude.Nothing,
      $sel:currencyCode:Reservation' :: Maybe Text
currencyCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Reservation' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:start:Reservation' :: Maybe Text
start = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:count:Reservation' :: Maybe Int
count = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:end:Reservation' :: Maybe Text
end = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Reservation' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reservationId:Reservation' :: Maybe Text
reservationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:offeringId:Reservation' :: Maybe Text
offeringId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:region:Reservation' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:offeringType:Reservation' :: Maybe OfferingType
offeringType = Maybe OfferingType
forall a. Maybe a
Prelude.Nothing,
      $sel:usagePrice:Reservation' :: Maybe Double
usagePrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:fixedPrice:Reservation' :: Maybe Double
fixedPrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:durationUnits:Reservation' :: Maybe OfferingDurationUnits
durationUnits = Maybe OfferingDurationUnits
forall a. Maybe a
Prelude.Nothing,
      $sel:offeringDescription:Reservation' :: Maybe Text
offeringDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:Reservation' :: Maybe Int
duration = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Reservation' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | Current state of reservation, e.g. \'ACTIVE\'
reservation_state :: Lens.Lens' Reservation (Prelude.Maybe ReservationState)
reservation_state :: (Maybe ReservationState -> f (Maybe ReservationState))
-> Reservation -> f Reservation
reservation_state = (Reservation -> Maybe ReservationState)
-> (Reservation -> Maybe ReservationState -> Reservation)
-> Lens
     Reservation
     Reservation
     (Maybe ReservationState)
     (Maybe ReservationState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe ReservationState
state :: Maybe ReservationState
$sel:state:Reservation' :: Reservation -> Maybe ReservationState
state} -> Maybe ReservationState
state) (\s :: Reservation
s@Reservation' {} Maybe ReservationState
a -> Reservation
s {$sel:state:Reservation' :: Maybe ReservationState
state = Maybe ReservationState
a} :: Reservation)

-- | Resource configuration details
reservation_resourceSpecification :: Lens.Lens' Reservation (Prelude.Maybe ReservationResourceSpecification)
reservation_resourceSpecification :: (Maybe ReservationResourceSpecification
 -> f (Maybe ReservationResourceSpecification))
-> Reservation -> f Reservation
reservation_resourceSpecification = (Reservation -> Maybe ReservationResourceSpecification)
-> (Reservation
    -> Maybe ReservationResourceSpecification -> Reservation)
-> Lens
     Reservation
     Reservation
     (Maybe ReservationResourceSpecification)
     (Maybe ReservationResourceSpecification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe ReservationResourceSpecification
resourceSpecification :: Maybe ReservationResourceSpecification
$sel:resourceSpecification:Reservation' :: Reservation -> Maybe ReservationResourceSpecification
resourceSpecification} -> Maybe ReservationResourceSpecification
resourceSpecification) (\s :: Reservation
s@Reservation' {} Maybe ReservationResourceSpecification
a -> Reservation
s {$sel:resourceSpecification:Reservation' :: Maybe ReservationResourceSpecification
resourceSpecification = Maybe ReservationResourceSpecification
a} :: Reservation)

-- | Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g.
-- \'USD\'
reservation_currencyCode :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_currencyCode :: (Maybe Text -> f (Maybe Text)) -> Reservation -> f Reservation
reservation_currencyCode = (Reservation -> Maybe Text)
-> (Reservation -> Maybe Text -> Reservation)
-> Lens Reservation Reservation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe Text
currencyCode :: Maybe Text
$sel:currencyCode:Reservation' :: Reservation -> Maybe Text
currencyCode} -> Maybe Text
currencyCode) (\s :: Reservation
s@Reservation' {} Maybe Text
a -> Reservation
s {$sel:currencyCode:Reservation' :: Maybe Text
currencyCode = Maybe Text
a} :: Reservation)

-- | Unique reservation ARN, e.g.
-- \'arn:aws:medialive:us-west-2:123456789012:reservation:1234567\'
reservation_arn :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_arn :: (Maybe Text -> f (Maybe Text)) -> Reservation -> f Reservation
reservation_arn = (Reservation -> Maybe Text)
-> (Reservation -> Maybe Text -> Reservation)
-> Lens Reservation Reservation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe Text
arn :: Maybe Text
$sel:arn:Reservation' :: Reservation -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Reservation
s@Reservation' {} Maybe Text
a -> Reservation
s {$sel:arn:Reservation' :: Maybe Text
arn = Maybe Text
a} :: Reservation)

-- | Reservation UTC start date and time in ISO-8601 format, e.g.
-- \'2018-03-01T00:00:00\'
reservation_start :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_start :: (Maybe Text -> f (Maybe Text)) -> Reservation -> f Reservation
reservation_start = (Reservation -> Maybe Text)
-> (Reservation -> Maybe Text -> Reservation)
-> Lens Reservation Reservation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe Text
start :: Maybe Text
$sel:start:Reservation' :: Reservation -> Maybe Text
start} -> Maybe Text
start) (\s :: Reservation
s@Reservation' {} Maybe Text
a -> Reservation
s {$sel:start:Reservation' :: Maybe Text
start = Maybe Text
a} :: Reservation)

-- | Number of reserved resources
reservation_count :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Int)
reservation_count :: (Maybe Int -> f (Maybe Int)) -> Reservation -> f Reservation
reservation_count = (Reservation -> Maybe Int)
-> (Reservation -> Maybe Int -> Reservation)
-> Lens Reservation Reservation (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe Int
count :: Maybe Int
$sel:count:Reservation' :: Reservation -> Maybe Int
count} -> Maybe Int
count) (\s :: Reservation
s@Reservation' {} Maybe Int
a -> Reservation
s {$sel:count:Reservation' :: Maybe Int
count = Maybe Int
a} :: Reservation)

-- | Reservation UTC end date and time in ISO-8601 format, e.g.
-- \'2019-03-01T00:00:00\'
reservation_end :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_end :: (Maybe Text -> f (Maybe Text)) -> Reservation -> f Reservation
reservation_end = (Reservation -> Maybe Text)
-> (Reservation -> Maybe Text -> Reservation)
-> Lens Reservation Reservation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe Text
end :: Maybe Text
$sel:end:Reservation' :: Reservation -> Maybe Text
end} -> Maybe Text
end) (\s :: Reservation
s@Reservation' {} Maybe Text
a -> Reservation
s {$sel:end:Reservation' :: Maybe Text
end = Maybe Text
a} :: Reservation)

-- | User specified reservation name
reservation_name :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_name :: (Maybe Text -> f (Maybe Text)) -> Reservation -> f Reservation
reservation_name = (Reservation -> Maybe Text)
-> (Reservation -> Maybe Text -> Reservation)
-> Lens Reservation Reservation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe Text
name :: Maybe Text
$sel:name:Reservation' :: Reservation -> Maybe Text
name} -> Maybe Text
name) (\s :: Reservation
s@Reservation' {} Maybe Text
a -> Reservation
s {$sel:name:Reservation' :: Maybe Text
name = Maybe Text
a} :: Reservation)

-- | Unique reservation ID, e.g. \'1234567\'
reservation_reservationId :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_reservationId :: (Maybe Text -> f (Maybe Text)) -> Reservation -> f Reservation
reservation_reservationId = (Reservation -> Maybe Text)
-> (Reservation -> Maybe Text -> Reservation)
-> Lens Reservation Reservation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe Text
reservationId :: Maybe Text
$sel:reservationId:Reservation' :: Reservation -> Maybe Text
reservationId} -> Maybe Text
reservationId) (\s :: Reservation
s@Reservation' {} Maybe Text
a -> Reservation
s {$sel:reservationId:Reservation' :: Maybe Text
reservationId = Maybe Text
a} :: Reservation)

-- | Unique offering ID, e.g. \'87654321\'
reservation_offeringId :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_offeringId :: (Maybe Text -> f (Maybe Text)) -> Reservation -> f Reservation
reservation_offeringId = (Reservation -> Maybe Text)
-> (Reservation -> Maybe Text -> Reservation)
-> Lens Reservation Reservation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe Text
offeringId :: Maybe Text
$sel:offeringId:Reservation' :: Reservation -> Maybe Text
offeringId} -> Maybe Text
offeringId) (\s :: Reservation
s@Reservation' {} Maybe Text
a -> Reservation
s {$sel:offeringId:Reservation' :: Maybe Text
offeringId = Maybe Text
a} :: Reservation)

-- | AWS region, e.g. \'us-west-2\'
reservation_region :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_region :: (Maybe Text -> f (Maybe Text)) -> Reservation -> f Reservation
reservation_region = (Reservation -> Maybe Text)
-> (Reservation -> Maybe Text -> Reservation)
-> Lens Reservation Reservation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe Text
region :: Maybe Text
$sel:region:Reservation' :: Reservation -> Maybe Text
region} -> Maybe Text
region) (\s :: Reservation
s@Reservation' {} Maybe Text
a -> Reservation
s {$sel:region:Reservation' :: Maybe Text
region = Maybe Text
a} :: Reservation)

-- | Offering type, e.g. \'NO_UPFRONT\'
reservation_offeringType :: Lens.Lens' Reservation (Prelude.Maybe OfferingType)
reservation_offeringType :: (Maybe OfferingType -> f (Maybe OfferingType))
-> Reservation -> f Reservation
reservation_offeringType = (Reservation -> Maybe OfferingType)
-> (Reservation -> Maybe OfferingType -> Reservation)
-> Lens
     Reservation Reservation (Maybe OfferingType) (Maybe OfferingType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe OfferingType
offeringType :: Maybe OfferingType
$sel:offeringType:Reservation' :: Reservation -> Maybe OfferingType
offeringType} -> Maybe OfferingType
offeringType) (\s :: Reservation
s@Reservation' {} Maybe OfferingType
a -> Reservation
s {$sel:offeringType:Reservation' :: Maybe OfferingType
offeringType = Maybe OfferingType
a} :: Reservation)

-- | Recurring usage charge for each reserved resource, e.g. \'157.0\'
reservation_usagePrice :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Double)
reservation_usagePrice :: (Maybe Double -> f (Maybe Double)) -> Reservation -> f Reservation
reservation_usagePrice = (Reservation -> Maybe Double)
-> (Reservation -> Maybe Double -> Reservation)
-> Lens Reservation Reservation (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe Double
usagePrice :: Maybe Double
$sel:usagePrice:Reservation' :: Reservation -> Maybe Double
usagePrice} -> Maybe Double
usagePrice) (\s :: Reservation
s@Reservation' {} Maybe Double
a -> Reservation
s {$sel:usagePrice:Reservation' :: Maybe Double
usagePrice = Maybe Double
a} :: Reservation)

-- | One-time charge for each reserved resource, e.g. \'0.0\' for a
-- NO_UPFRONT offering
reservation_fixedPrice :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Double)
reservation_fixedPrice :: (Maybe Double -> f (Maybe Double)) -> Reservation -> f Reservation
reservation_fixedPrice = (Reservation -> Maybe Double)
-> (Reservation -> Maybe Double -> Reservation)
-> Lens Reservation Reservation (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe Double
fixedPrice :: Maybe Double
$sel:fixedPrice:Reservation' :: Reservation -> Maybe Double
fixedPrice} -> Maybe Double
fixedPrice) (\s :: Reservation
s@Reservation' {} Maybe Double
a -> Reservation
s {$sel:fixedPrice:Reservation' :: Maybe Double
fixedPrice = Maybe Double
a} :: Reservation)

-- | Units for duration, e.g. \'MONTHS\'
reservation_durationUnits :: Lens.Lens' Reservation (Prelude.Maybe OfferingDurationUnits)
reservation_durationUnits :: (Maybe OfferingDurationUnits -> f (Maybe OfferingDurationUnits))
-> Reservation -> f Reservation
reservation_durationUnits = (Reservation -> Maybe OfferingDurationUnits)
-> (Reservation -> Maybe OfferingDurationUnits -> Reservation)
-> Lens
     Reservation
     Reservation
     (Maybe OfferingDurationUnits)
     (Maybe OfferingDurationUnits)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe OfferingDurationUnits
durationUnits :: Maybe OfferingDurationUnits
$sel:durationUnits:Reservation' :: Reservation -> Maybe OfferingDurationUnits
durationUnits} -> Maybe OfferingDurationUnits
durationUnits) (\s :: Reservation
s@Reservation' {} Maybe OfferingDurationUnits
a -> Reservation
s {$sel:durationUnits:Reservation' :: Maybe OfferingDurationUnits
durationUnits = Maybe OfferingDurationUnits
a} :: Reservation)

-- | Offering description, e.g. \'HD AVC output at 10-20 Mbps, 30 fps, and
-- standard VQ in US West (Oregon)\'
reservation_offeringDescription :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_offeringDescription :: (Maybe Text -> f (Maybe Text)) -> Reservation -> f Reservation
reservation_offeringDescription = (Reservation -> Maybe Text)
-> (Reservation -> Maybe Text -> Reservation)
-> Lens Reservation Reservation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe Text
offeringDescription :: Maybe Text
$sel:offeringDescription:Reservation' :: Reservation -> Maybe Text
offeringDescription} -> Maybe Text
offeringDescription) (\s :: Reservation
s@Reservation' {} Maybe Text
a -> Reservation
s {$sel:offeringDescription:Reservation' :: Maybe Text
offeringDescription = Maybe Text
a} :: Reservation)

-- | Lease duration, e.g. \'12\'
reservation_duration :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Int)
reservation_duration :: (Maybe Int -> f (Maybe Int)) -> Reservation -> f Reservation
reservation_duration = (Reservation -> Maybe Int)
-> (Reservation -> Maybe Int -> Reservation)
-> Lens Reservation Reservation (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe Int
duration :: Maybe Int
$sel:duration:Reservation' :: Reservation -> Maybe Int
duration} -> Maybe Int
duration) (\s :: Reservation
s@Reservation' {} Maybe Int
a -> Reservation
s {$sel:duration:Reservation' :: Maybe Int
duration = Maybe Int
a} :: Reservation)

-- | A collection of key-value pairs
reservation_tags :: Lens.Lens' Reservation (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
reservation_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Reservation -> f Reservation
reservation_tags = (Reservation -> Maybe (HashMap Text Text))
-> (Reservation -> Maybe (HashMap Text Text) -> Reservation)
-> Lens
     Reservation
     Reservation
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Reservation' :: Reservation -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Reservation
s@Reservation' {} Maybe (HashMap Text Text)
a -> Reservation
s {$sel:tags:Reservation' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Reservation) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> Reservation -> f Reservation)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Reservation
-> f Reservation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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 ->
          Maybe ReservationState
-> Maybe ReservationResourceSpecification
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe OfferingType
-> Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Maybe (HashMap Text Text)
-> Reservation
Reservation'
            (Maybe ReservationState
 -> Maybe ReservationResourceSpecification
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe OfferingType
 -> Maybe Double
 -> Maybe Double
 -> Maybe OfferingDurationUnits
 -> Maybe Text
 -> Maybe Int
 -> Maybe (HashMap Text Text)
 -> Reservation)
-> Parser (Maybe ReservationState)
-> Parser
     (Maybe ReservationResourceSpecification
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe OfferingType
      -> Maybe Double
      -> Maybe Double
      -> Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ReservationState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
            Parser
  (Maybe ReservationResourceSpecification
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe OfferingType
   -> Maybe Double
   -> Maybe Double
   -> Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe ReservationResourceSpecification)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe OfferingType
      -> Maybe Double
      -> Maybe Double
      -> Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ReservationResourceSpecification)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceSpecification")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe OfferingType
   -> Maybe Double
   -> Maybe Double
   -> Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe OfferingType
      -> Maybe Double
      -> Maybe Double
      -> Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"currencyCode")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe OfferingType
   -> Maybe Double
   -> Maybe Double
   -> Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe OfferingType
      -> Maybe Double
      -> Maybe Double
      -> Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"arn")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe OfferingType
   -> Maybe Double
   -> Maybe Double
   -> Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe OfferingType
      -> Maybe Double
      -> Maybe Double
      -> Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"start")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe OfferingType
   -> Maybe Double
   -> Maybe Double
   -> Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe OfferingType
      -> Maybe Double
      -> Maybe Double
      -> Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
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
"count")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe OfferingType
   -> Maybe Double
   -> Maybe Double
   -> Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe OfferingType
      -> Maybe Double
      -> Maybe Double
      -> Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"end")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe OfferingType
   -> Maybe Double
   -> Maybe Double
   -> Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe OfferingType
      -> Maybe Double
      -> Maybe Double
      -> Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe OfferingType
   -> Maybe Double
   -> Maybe Double
   -> Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe OfferingType
      -> Maybe Double
      -> Maybe Double
      -> Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"reservationId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe OfferingType
   -> Maybe Double
   -> Maybe Double
   -> Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe OfferingType
      -> Maybe Double
      -> Maybe Double
      -> Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"offeringId")
            Parser
  (Maybe Text
   -> Maybe OfferingType
   -> Maybe Double
   -> Maybe Double
   -> Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe Text)
-> Parser
     (Maybe OfferingType
      -> Maybe Double
      -> Maybe Double
      -> Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"region")
            Parser
  (Maybe OfferingType
   -> Maybe Double
   -> Maybe Double
   -> Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe OfferingType)
-> Parser
     (Maybe Double
      -> Maybe Double
      -> Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OfferingType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"offeringType")
            Parser
  (Maybe Double
   -> Maybe Double
   -> Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe Double)
-> Parser
     (Maybe Double
      -> Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"usagePrice")
            Parser
  (Maybe Double
   -> Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe Double)
-> Parser
     (Maybe OfferingDurationUnits
      -> Maybe Text
      -> Maybe Int
      -> Maybe (HashMap Text Text)
      -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"fixedPrice")
            Parser
  (Maybe OfferingDurationUnits
   -> Maybe Text
   -> Maybe Int
   -> Maybe (HashMap Text Text)
   -> Reservation)
-> Parser (Maybe OfferingDurationUnits)
-> Parser
     (Maybe Text
      -> Maybe Int -> Maybe (HashMap Text Text) -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OfferingDurationUnits)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"durationUnits")
            Parser
  (Maybe Text
   -> Maybe Int -> Maybe (HashMap Text Text) -> Reservation)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe (HashMap Text Text) -> Reservation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"offeringDescription")
            Parser (Maybe Int -> Maybe (HashMap Text Text) -> Reservation)
-> Parser (Maybe Int)
-> Parser (Maybe (HashMap Text Text) -> Reservation)
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
"duration")
            Parser (Maybe (HashMap Text Text) -> Reservation)
-> Parser (Maybe (HashMap Text Text)) -> Parser Reservation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable Reservation

instance Prelude.NFData Reservation