{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaLive.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.MediaLive.Types.OfferingDurationUnits
import Amazonka.MediaLive.Types.OfferingType
import Amazonka.MediaLive.Types.RenewalSettings
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'
  { -- | Unique reservation ARN, e.g.
    -- \'arn:aws:medialive:us-west-2:123456789012:reservation:1234567\'
    Reservation -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Number of reserved resources
    Reservation -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
    -- | Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g.
    -- \'USD\'
    Reservation -> Maybe Text
currencyCode :: Prelude.Maybe Prelude.Text,
    -- | Lease duration, e.g. \'12\'
    Reservation -> Maybe Int
duration :: Prelude.Maybe Prelude.Int,
    -- | Units for duration, e.g. \'MONTHS\'
    Reservation -> Maybe OfferingDurationUnits
durationUnits :: Prelude.Maybe OfferingDurationUnits,
    -- | 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,
    -- | One-time charge for each reserved resource, e.g. \'0.0\' for a
    -- NO_UPFRONT offering
    Reservation -> Maybe Double
fixedPrice :: Prelude.Maybe Prelude.Double,
    -- | User specified reservation name
    Reservation -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | Unique offering ID, e.g. \'87654321\'
    Reservation -> Maybe Text
offeringId :: Prelude.Maybe Prelude.Text,
    -- | Offering type, e.g. \'NO_UPFRONT\'
    Reservation -> Maybe OfferingType
offeringType :: Prelude.Maybe OfferingType,
    -- | AWS region, e.g. \'us-west-2\'
    Reservation -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | Renewal settings for the reservation
    Reservation -> Maybe RenewalSettings
renewalSettings :: Prelude.Maybe RenewalSettings,
    -- | Unique reservation ID, e.g. \'1234567\'
    Reservation -> Maybe Text
reservationId :: Prelude.Maybe Prelude.Text,
    -- | Resource configuration details
    Reservation -> Maybe ReservationResourceSpecification
resourceSpecification :: Prelude.Maybe ReservationResourceSpecification,
    -- | 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,
    -- | Current state of reservation, e.g. \'ACTIVE\'
    Reservation -> Maybe ReservationState
state :: Prelude.Maybe ReservationState,
    -- | A collection of key-value pairs
    Reservation -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Recurring usage charge for each reserved resource, e.g. \'157.0\'
    Reservation -> Maybe Double
usagePrice :: Prelude.Maybe Prelude.Double
  }
  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)

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

-- | 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 :: Lens' Reservation (Maybe Text)
reservation_arn = 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)

-- | Number of reserved resources
reservation_count :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Int)
reservation_count :: Lens' Reservation (Maybe Int)
reservation_count = 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)

-- | Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g.
-- \'USD\'
reservation_currencyCode :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_currencyCode :: Lens' Reservation (Maybe Text)
reservation_currencyCode = 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)

-- | Lease duration, e.g. \'12\'
reservation_duration :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Int)
reservation_duration :: Lens' Reservation (Maybe Int)
reservation_duration = 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)

-- | Units for duration, e.g. \'MONTHS\'
reservation_durationUnits :: Lens.Lens' Reservation (Prelude.Maybe OfferingDurationUnits)
reservation_durationUnits :: Lens' Reservation (Maybe OfferingDurationUnits)
reservation_durationUnits = 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)

-- | 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 :: Lens' Reservation (Maybe Text)
reservation_end = 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)

-- | 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 :: Lens' Reservation (Maybe Double)
reservation_fixedPrice = 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)

-- | User specified reservation name
reservation_name :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_name :: Lens' Reservation (Maybe Text)
reservation_name = 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)

-- | 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 :: Lens' Reservation (Maybe Text)
reservation_offeringDescription = 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)

-- | Unique offering ID, e.g. \'87654321\'
reservation_offeringId :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_offeringId :: Lens' Reservation (Maybe Text)
reservation_offeringId = 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)

-- | Offering type, e.g. \'NO_UPFRONT\'
reservation_offeringType :: Lens.Lens' Reservation (Prelude.Maybe OfferingType)
reservation_offeringType :: Lens' Reservation (Maybe OfferingType)
reservation_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)

-- | AWS region, e.g. \'us-west-2\'
reservation_region :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_region :: Lens' Reservation (Maybe Text)
reservation_region = 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)

-- | Renewal settings for the reservation
reservation_renewalSettings :: Lens.Lens' Reservation (Prelude.Maybe RenewalSettings)
reservation_renewalSettings :: Lens' Reservation (Maybe RenewalSettings)
reservation_renewalSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Reservation' {Maybe RenewalSettings
renewalSettings :: Maybe RenewalSettings
$sel:renewalSettings:Reservation' :: Reservation -> Maybe RenewalSettings
renewalSettings} -> Maybe RenewalSettings
renewalSettings) (\s :: Reservation
s@Reservation' {} Maybe RenewalSettings
a -> Reservation
s {$sel:renewalSettings:Reservation' :: Maybe RenewalSettings
renewalSettings = Maybe RenewalSettings
a} :: Reservation)

-- | Unique reservation ID, e.g. \'1234567\'
reservation_reservationId :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Text)
reservation_reservationId :: Lens' Reservation (Maybe Text)
reservation_reservationId = 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)

-- | Resource configuration details
reservation_resourceSpecification :: Lens.Lens' Reservation (Prelude.Maybe ReservationResourceSpecification)
reservation_resourceSpecification :: Lens' Reservation (Maybe ReservationResourceSpecification)
reservation_resourceSpecification = 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)

-- | 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 :: Lens' Reservation (Maybe Text)
reservation_start = 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)

-- | Current state of reservation, e.g. \'ACTIVE\'
reservation_state :: Lens.Lens' Reservation (Prelude.Maybe ReservationState)
reservation_state :: Lens' Reservation (Maybe ReservationState)
reservation_state = 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)

-- | A collection of key-value pairs
reservation_tags :: Lens.Lens' Reservation (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
reservation_tags :: Lens' Reservation (Maybe (HashMap Text Text))
reservation_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Recurring usage charge for each reserved resource, e.g. \'157.0\'
reservation_usagePrice :: Lens.Lens' Reservation (Prelude.Maybe Prelude.Double)
reservation_usagePrice :: Lens' Reservation (Maybe Double)
reservation_usagePrice = 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)

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

instance Prelude.Hashable Reservation where
  hashWithSalt :: Int -> Reservation -> Int
hashWithSalt Int
_salt Reservation' {Maybe Double
Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Maybe OfferingDurationUnits
Maybe OfferingType
Maybe RenewalSettings
Maybe ReservationState
Maybe ReservationResourceSpecification
usagePrice :: Maybe Double
tags :: Maybe (HashMap Text Text)
state :: Maybe ReservationState
start :: Maybe Text
resourceSpecification :: Maybe ReservationResourceSpecification
reservationId :: Maybe Text
renewalSettings :: Maybe RenewalSettings
region :: Maybe Text
offeringType :: Maybe OfferingType
offeringId :: Maybe Text
offeringDescription :: Maybe Text
name :: Maybe Text
fixedPrice :: Maybe Double
end :: Maybe Text
durationUnits :: Maybe OfferingDurationUnits
duration :: Maybe Int
currencyCode :: Maybe Text
count :: Maybe Int
arn :: Maybe Text
$sel:usagePrice:Reservation' :: Reservation -> Maybe Double
$sel:tags:Reservation' :: Reservation -> Maybe (HashMap Text Text)
$sel:state:Reservation' :: Reservation -> Maybe ReservationState
$sel:start:Reservation' :: Reservation -> Maybe Text
$sel:resourceSpecification:Reservation' :: Reservation -> Maybe ReservationResourceSpecification
$sel:reservationId:Reservation' :: Reservation -> Maybe Text
$sel:renewalSettings:Reservation' :: Reservation -> Maybe RenewalSettings
$sel:region:Reservation' :: Reservation -> Maybe Text
$sel:offeringType:Reservation' :: Reservation -> Maybe OfferingType
$sel:offeringId:Reservation' :: Reservation -> Maybe Text
$sel:offeringDescription:Reservation' :: Reservation -> Maybe Text
$sel:name:Reservation' :: Reservation -> Maybe Text
$sel:fixedPrice:Reservation' :: Reservation -> Maybe Double
$sel:end:Reservation' :: Reservation -> Maybe Text
$sel:durationUnits:Reservation' :: Reservation -> Maybe OfferingDurationUnits
$sel:duration:Reservation' :: Reservation -> Maybe Int
$sel:currencyCode:Reservation' :: Reservation -> Maybe Text
$sel:count:Reservation' :: Reservation -> Maybe Int
$sel:arn:Reservation' :: Reservation -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
count
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
currencyCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
duration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OfferingDurationUnits
durationUnits
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
end
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
fixedPrice
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
offeringDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
offeringId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OfferingType
offeringType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
region
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RenewalSettings
renewalSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
reservationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReservationResourceSpecification
resourceSpecification
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
start
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReservationState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
usagePrice

instance Prelude.NFData Reservation where
  rnf :: Reservation -> ()
rnf Reservation' {Maybe Double
Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Maybe OfferingDurationUnits
Maybe OfferingType
Maybe RenewalSettings
Maybe ReservationState
Maybe ReservationResourceSpecification
usagePrice :: Maybe Double
tags :: Maybe (HashMap Text Text)
state :: Maybe ReservationState
start :: Maybe Text
resourceSpecification :: Maybe ReservationResourceSpecification
reservationId :: Maybe Text
renewalSettings :: Maybe RenewalSettings
region :: Maybe Text
offeringType :: Maybe OfferingType
offeringId :: Maybe Text
offeringDescription :: Maybe Text
name :: Maybe Text
fixedPrice :: Maybe Double
end :: Maybe Text
durationUnits :: Maybe OfferingDurationUnits
duration :: Maybe Int
currencyCode :: Maybe Text
count :: Maybe Int
arn :: Maybe Text
$sel:usagePrice:Reservation' :: Reservation -> Maybe Double
$sel:tags:Reservation' :: Reservation -> Maybe (HashMap Text Text)
$sel:state:Reservation' :: Reservation -> Maybe ReservationState
$sel:start:Reservation' :: Reservation -> Maybe Text
$sel:resourceSpecification:Reservation' :: Reservation -> Maybe ReservationResourceSpecification
$sel:reservationId:Reservation' :: Reservation -> Maybe Text
$sel:renewalSettings:Reservation' :: Reservation -> Maybe RenewalSettings
$sel:region:Reservation' :: Reservation -> Maybe Text
$sel:offeringType:Reservation' :: Reservation -> Maybe OfferingType
$sel:offeringId:Reservation' :: Reservation -> Maybe Text
$sel:offeringDescription:Reservation' :: Reservation -> Maybe Text
$sel:name:Reservation' :: Reservation -> Maybe Text
$sel:fixedPrice:Reservation' :: Reservation -> Maybe Double
$sel:end:Reservation' :: Reservation -> Maybe Text
$sel:durationUnits:Reservation' :: Reservation -> Maybe OfferingDurationUnits
$sel:duration:Reservation' :: Reservation -> Maybe Int
$sel:currencyCode:Reservation' :: Reservation -> Maybe Text
$sel:count:Reservation' :: Reservation -> Maybe Int
$sel:arn:Reservation' :: Reservation -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
count
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
currencyCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
duration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OfferingDurationUnits
durationUnits
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
end
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
fixedPrice
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
offeringDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
offeringId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OfferingType
offeringType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
region
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RenewalSettings
renewalSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reservationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReservationResourceSpecification
resourceSpecification
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
start
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReservationState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
usagePrice