{-# 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.EC2.Types.HostReservation
-- 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.EC2.Types.HostReservation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.CurrencyCodeValues
import Amazonka.EC2.Types.PaymentOption
import Amazonka.EC2.Types.ReservationState
import Amazonka.EC2.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | Details about the Dedicated Host Reservation and associated Dedicated
-- Hosts.
--
-- /See:/ 'newHostReservation' smart constructor.
data HostReservation = HostReservation'
  { -- | The number of Dedicated Hosts the reservation is associated with.
    HostReservation -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
    -- | The currency in which the @upfrontPrice@ and @hourlyPrice@ amounts are
    -- specified. At this time, the only supported currency is @USD@.
    HostReservation -> Maybe CurrencyCodeValues
currencyCode :: Prelude.Maybe CurrencyCodeValues,
    -- | The length of the reservation\'s term, specified in seconds. Can be
    -- @31536000 (1 year)@ | @94608000 (3 years)@.
    HostReservation -> Maybe Int
duration :: Prelude.Maybe Prelude.Int,
    -- | The date and time that the reservation ends.
    HostReservation -> Maybe ISO8601
end :: Prelude.Maybe Data.ISO8601,
    -- | The IDs of the Dedicated Hosts associated with the reservation.
    HostReservation -> Maybe [Text]
hostIdSet :: Prelude.Maybe [Prelude.Text],
    -- | The ID of the reservation that specifies the associated Dedicated Hosts.
    HostReservation -> Maybe Text
hostReservationId :: Prelude.Maybe Prelude.Text,
    -- | The hourly price of the reservation.
    HostReservation -> Maybe Text
hourlyPrice :: Prelude.Maybe Prelude.Text,
    -- | The instance family of the Dedicated Host Reservation. The instance
    -- family on the Dedicated Host must be the same in order for it to benefit
    -- from the reservation.
    HostReservation -> Maybe Text
instanceFamily :: Prelude.Maybe Prelude.Text,
    -- | The ID of the reservation. This remains the same regardless of which
    -- Dedicated Hosts are associated with it.
    HostReservation -> Maybe Text
offeringId :: Prelude.Maybe Prelude.Text,
    -- | The payment option selected for this reservation.
    HostReservation -> Maybe PaymentOption
paymentOption :: Prelude.Maybe PaymentOption,
    -- | The date and time that the reservation started.
    HostReservation -> Maybe ISO8601
start :: Prelude.Maybe Data.ISO8601,
    -- | The state of the reservation.
    HostReservation -> Maybe ReservationState
state :: Prelude.Maybe ReservationState,
    -- | Any tags assigned to the Dedicated Host Reservation.
    HostReservation -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The upfront price of the reservation.
    HostReservation -> Maybe Text
upfrontPrice :: Prelude.Maybe Prelude.Text
  }
  deriving (HostReservation -> HostReservation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HostReservation -> HostReservation -> Bool
$c/= :: HostReservation -> HostReservation -> Bool
== :: HostReservation -> HostReservation -> Bool
$c== :: HostReservation -> HostReservation -> Bool
Prelude.Eq, ReadPrec [HostReservation]
ReadPrec HostReservation
Int -> ReadS HostReservation
ReadS [HostReservation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HostReservation]
$creadListPrec :: ReadPrec [HostReservation]
readPrec :: ReadPrec HostReservation
$creadPrec :: ReadPrec HostReservation
readList :: ReadS [HostReservation]
$creadList :: ReadS [HostReservation]
readsPrec :: Int -> ReadS HostReservation
$creadsPrec :: Int -> ReadS HostReservation
Prelude.Read, Int -> HostReservation -> ShowS
[HostReservation] -> ShowS
HostReservation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HostReservation] -> ShowS
$cshowList :: [HostReservation] -> ShowS
show :: HostReservation -> String
$cshow :: HostReservation -> String
showsPrec :: Int -> HostReservation -> ShowS
$cshowsPrec :: Int -> HostReservation -> ShowS
Prelude.Show, forall x. Rep HostReservation x -> HostReservation
forall x. HostReservation -> Rep HostReservation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HostReservation x -> HostReservation
$cfrom :: forall x. HostReservation -> Rep HostReservation x
Prelude.Generic)

-- |
-- Create a value of 'HostReservation' 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:
--
-- 'count', 'hostReservation_count' - The number of Dedicated Hosts the reservation is associated with.
--
-- 'currencyCode', 'hostReservation_currencyCode' - The currency in which the @upfrontPrice@ and @hourlyPrice@ amounts are
-- specified. At this time, the only supported currency is @USD@.
--
-- 'duration', 'hostReservation_duration' - The length of the reservation\'s term, specified in seconds. Can be
-- @31536000 (1 year)@ | @94608000 (3 years)@.
--
-- 'end', 'hostReservation_end' - The date and time that the reservation ends.
--
-- 'hostIdSet', 'hostReservation_hostIdSet' - The IDs of the Dedicated Hosts associated with the reservation.
--
-- 'hostReservationId', 'hostReservation_hostReservationId' - The ID of the reservation that specifies the associated Dedicated Hosts.
--
-- 'hourlyPrice', 'hostReservation_hourlyPrice' - The hourly price of the reservation.
--
-- 'instanceFamily', 'hostReservation_instanceFamily' - The instance family of the Dedicated Host Reservation. The instance
-- family on the Dedicated Host must be the same in order for it to benefit
-- from the reservation.
--
-- 'offeringId', 'hostReservation_offeringId' - The ID of the reservation. This remains the same regardless of which
-- Dedicated Hosts are associated with it.
--
-- 'paymentOption', 'hostReservation_paymentOption' - The payment option selected for this reservation.
--
-- 'start', 'hostReservation_start' - The date and time that the reservation started.
--
-- 'state', 'hostReservation_state' - The state of the reservation.
--
-- 'tags', 'hostReservation_tags' - Any tags assigned to the Dedicated Host Reservation.
--
-- 'upfrontPrice', 'hostReservation_upfrontPrice' - The upfront price of the reservation.
newHostReservation ::
  HostReservation
newHostReservation :: HostReservation
newHostReservation =
  HostReservation'
    { $sel:count:HostReservation' :: Maybe Int
count = forall a. Maybe a
Prelude.Nothing,
      $sel:currencyCode:HostReservation' :: Maybe CurrencyCodeValues
currencyCode = forall a. Maybe a
Prelude.Nothing,
      $sel:duration:HostReservation' :: Maybe Int
duration = forall a. Maybe a
Prelude.Nothing,
      $sel:end:HostReservation' :: Maybe ISO8601
end = forall a. Maybe a
Prelude.Nothing,
      $sel:hostIdSet:HostReservation' :: Maybe [Text]
hostIdSet = forall a. Maybe a
Prelude.Nothing,
      $sel:hostReservationId:HostReservation' :: Maybe Text
hostReservationId = forall a. Maybe a
Prelude.Nothing,
      $sel:hourlyPrice:HostReservation' :: Maybe Text
hourlyPrice = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceFamily:HostReservation' :: Maybe Text
instanceFamily = forall a. Maybe a
Prelude.Nothing,
      $sel:offeringId:HostReservation' :: Maybe Text
offeringId = forall a. Maybe a
Prelude.Nothing,
      $sel:paymentOption:HostReservation' :: Maybe PaymentOption
paymentOption = forall a. Maybe a
Prelude.Nothing,
      $sel:start:HostReservation' :: Maybe ISO8601
start = forall a. Maybe a
Prelude.Nothing,
      $sel:state:HostReservation' :: Maybe ReservationState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:HostReservation' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:upfrontPrice:HostReservation' :: Maybe Text
upfrontPrice = forall a. Maybe a
Prelude.Nothing
    }

-- | The number of Dedicated Hosts the reservation is associated with.
hostReservation_count :: Lens.Lens' HostReservation (Prelude.Maybe Prelude.Int)
hostReservation_count :: Lens' HostReservation (Maybe Int)
hostReservation_count = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe Int
count :: Maybe Int
$sel:count:HostReservation' :: HostReservation -> Maybe Int
count} -> Maybe Int
count) (\s :: HostReservation
s@HostReservation' {} Maybe Int
a -> HostReservation
s {$sel:count:HostReservation' :: Maybe Int
count = Maybe Int
a} :: HostReservation)

-- | The currency in which the @upfrontPrice@ and @hourlyPrice@ amounts are
-- specified. At this time, the only supported currency is @USD@.
hostReservation_currencyCode :: Lens.Lens' HostReservation (Prelude.Maybe CurrencyCodeValues)
hostReservation_currencyCode :: Lens' HostReservation (Maybe CurrencyCodeValues)
hostReservation_currencyCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe CurrencyCodeValues
currencyCode :: Maybe CurrencyCodeValues
$sel:currencyCode:HostReservation' :: HostReservation -> Maybe CurrencyCodeValues
currencyCode} -> Maybe CurrencyCodeValues
currencyCode) (\s :: HostReservation
s@HostReservation' {} Maybe CurrencyCodeValues
a -> HostReservation
s {$sel:currencyCode:HostReservation' :: Maybe CurrencyCodeValues
currencyCode = Maybe CurrencyCodeValues
a} :: HostReservation)

-- | The length of the reservation\'s term, specified in seconds. Can be
-- @31536000 (1 year)@ | @94608000 (3 years)@.
hostReservation_duration :: Lens.Lens' HostReservation (Prelude.Maybe Prelude.Int)
hostReservation_duration :: Lens' HostReservation (Maybe Int)
hostReservation_duration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe Int
duration :: Maybe Int
$sel:duration:HostReservation' :: HostReservation -> Maybe Int
duration} -> Maybe Int
duration) (\s :: HostReservation
s@HostReservation' {} Maybe Int
a -> HostReservation
s {$sel:duration:HostReservation' :: Maybe Int
duration = Maybe Int
a} :: HostReservation)

-- | The date and time that the reservation ends.
hostReservation_end :: Lens.Lens' HostReservation (Prelude.Maybe Prelude.UTCTime)
hostReservation_end :: Lens' HostReservation (Maybe UTCTime)
hostReservation_end = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe ISO8601
end :: Maybe ISO8601
$sel:end:HostReservation' :: HostReservation -> Maybe ISO8601
end} -> Maybe ISO8601
end) (\s :: HostReservation
s@HostReservation' {} Maybe ISO8601
a -> HostReservation
s {$sel:end:HostReservation' :: Maybe ISO8601
end = Maybe ISO8601
a} :: HostReservation) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The IDs of the Dedicated Hosts associated with the reservation.
hostReservation_hostIdSet :: Lens.Lens' HostReservation (Prelude.Maybe [Prelude.Text])
hostReservation_hostIdSet :: Lens' HostReservation (Maybe [Text])
hostReservation_hostIdSet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe [Text]
hostIdSet :: Maybe [Text]
$sel:hostIdSet:HostReservation' :: HostReservation -> Maybe [Text]
hostIdSet} -> Maybe [Text]
hostIdSet) (\s :: HostReservation
s@HostReservation' {} Maybe [Text]
a -> HostReservation
s {$sel:hostIdSet:HostReservation' :: Maybe [Text]
hostIdSet = Maybe [Text]
a} :: HostReservation) 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

-- | The ID of the reservation that specifies the associated Dedicated Hosts.
hostReservation_hostReservationId :: Lens.Lens' HostReservation (Prelude.Maybe Prelude.Text)
hostReservation_hostReservationId :: Lens' HostReservation (Maybe Text)
hostReservation_hostReservationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe Text
hostReservationId :: Maybe Text
$sel:hostReservationId:HostReservation' :: HostReservation -> Maybe Text
hostReservationId} -> Maybe Text
hostReservationId) (\s :: HostReservation
s@HostReservation' {} Maybe Text
a -> HostReservation
s {$sel:hostReservationId:HostReservation' :: Maybe Text
hostReservationId = Maybe Text
a} :: HostReservation)

-- | The hourly price of the reservation.
hostReservation_hourlyPrice :: Lens.Lens' HostReservation (Prelude.Maybe Prelude.Text)
hostReservation_hourlyPrice :: Lens' HostReservation (Maybe Text)
hostReservation_hourlyPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe Text
hourlyPrice :: Maybe Text
$sel:hourlyPrice:HostReservation' :: HostReservation -> Maybe Text
hourlyPrice} -> Maybe Text
hourlyPrice) (\s :: HostReservation
s@HostReservation' {} Maybe Text
a -> HostReservation
s {$sel:hourlyPrice:HostReservation' :: Maybe Text
hourlyPrice = Maybe Text
a} :: HostReservation)

-- | The instance family of the Dedicated Host Reservation. The instance
-- family on the Dedicated Host must be the same in order for it to benefit
-- from the reservation.
hostReservation_instanceFamily :: Lens.Lens' HostReservation (Prelude.Maybe Prelude.Text)
hostReservation_instanceFamily :: Lens' HostReservation (Maybe Text)
hostReservation_instanceFamily = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe Text
instanceFamily :: Maybe Text
$sel:instanceFamily:HostReservation' :: HostReservation -> Maybe Text
instanceFamily} -> Maybe Text
instanceFamily) (\s :: HostReservation
s@HostReservation' {} Maybe Text
a -> HostReservation
s {$sel:instanceFamily:HostReservation' :: Maybe Text
instanceFamily = Maybe Text
a} :: HostReservation)

-- | The ID of the reservation. This remains the same regardless of which
-- Dedicated Hosts are associated with it.
hostReservation_offeringId :: Lens.Lens' HostReservation (Prelude.Maybe Prelude.Text)
hostReservation_offeringId :: Lens' HostReservation (Maybe Text)
hostReservation_offeringId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe Text
offeringId :: Maybe Text
$sel:offeringId:HostReservation' :: HostReservation -> Maybe Text
offeringId} -> Maybe Text
offeringId) (\s :: HostReservation
s@HostReservation' {} Maybe Text
a -> HostReservation
s {$sel:offeringId:HostReservation' :: Maybe Text
offeringId = Maybe Text
a} :: HostReservation)

-- | The payment option selected for this reservation.
hostReservation_paymentOption :: Lens.Lens' HostReservation (Prelude.Maybe PaymentOption)
hostReservation_paymentOption :: Lens' HostReservation (Maybe PaymentOption)
hostReservation_paymentOption = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe PaymentOption
paymentOption :: Maybe PaymentOption
$sel:paymentOption:HostReservation' :: HostReservation -> Maybe PaymentOption
paymentOption} -> Maybe PaymentOption
paymentOption) (\s :: HostReservation
s@HostReservation' {} Maybe PaymentOption
a -> HostReservation
s {$sel:paymentOption:HostReservation' :: Maybe PaymentOption
paymentOption = Maybe PaymentOption
a} :: HostReservation)

-- | The date and time that the reservation started.
hostReservation_start :: Lens.Lens' HostReservation (Prelude.Maybe Prelude.UTCTime)
hostReservation_start :: Lens' HostReservation (Maybe UTCTime)
hostReservation_start = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe ISO8601
start :: Maybe ISO8601
$sel:start:HostReservation' :: HostReservation -> Maybe ISO8601
start} -> Maybe ISO8601
start) (\s :: HostReservation
s@HostReservation' {} Maybe ISO8601
a -> HostReservation
s {$sel:start:HostReservation' :: Maybe ISO8601
start = Maybe ISO8601
a} :: HostReservation) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The state of the reservation.
hostReservation_state :: Lens.Lens' HostReservation (Prelude.Maybe ReservationState)
hostReservation_state :: Lens' HostReservation (Maybe ReservationState)
hostReservation_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe ReservationState
state :: Maybe ReservationState
$sel:state:HostReservation' :: HostReservation -> Maybe ReservationState
state} -> Maybe ReservationState
state) (\s :: HostReservation
s@HostReservation' {} Maybe ReservationState
a -> HostReservation
s {$sel:state:HostReservation' :: Maybe ReservationState
state = Maybe ReservationState
a} :: HostReservation)

-- | Any tags assigned to the Dedicated Host Reservation.
hostReservation_tags :: Lens.Lens' HostReservation (Prelude.Maybe [Tag])
hostReservation_tags :: Lens' HostReservation (Maybe [Tag])
hostReservation_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:HostReservation' :: HostReservation -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: HostReservation
s@HostReservation' {} Maybe [Tag]
a -> HostReservation
s {$sel:tags:HostReservation' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: HostReservation) 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

-- | The upfront price of the reservation.
hostReservation_upfrontPrice :: Lens.Lens' HostReservation (Prelude.Maybe Prelude.Text)
hostReservation_upfrontPrice :: Lens' HostReservation (Maybe Text)
hostReservation_upfrontPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostReservation' {Maybe Text
upfrontPrice :: Maybe Text
$sel:upfrontPrice:HostReservation' :: HostReservation -> Maybe Text
upfrontPrice} -> Maybe Text
upfrontPrice) (\s :: HostReservation
s@HostReservation' {} Maybe Text
a -> HostReservation
s {$sel:upfrontPrice:HostReservation' :: Maybe Text
upfrontPrice = Maybe Text
a} :: HostReservation)

instance Data.FromXML HostReservation where
  parseXML :: [Node] -> Either String HostReservation
parseXML [Node]
x =
    Maybe Int
-> Maybe CurrencyCodeValues
-> Maybe Int
-> Maybe ISO8601
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PaymentOption
-> Maybe ISO8601
-> Maybe ReservationState
-> Maybe [Tag]
-> Maybe Text
-> HostReservation
HostReservation'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"count")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"currencyCode")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"duration")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"end")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"hostIdSet"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"hostReservationId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"hourlyPrice")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"instanceFamily")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"offeringId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"paymentOption")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"start")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"state")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"tagSet"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"upfrontPrice")

instance Prelude.Hashable HostReservation where
  hashWithSalt :: Int -> HostReservation -> Int
hashWithSalt Int
_salt HostReservation' {Maybe Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Maybe ISO8601
Maybe CurrencyCodeValues
Maybe PaymentOption
Maybe ReservationState
upfrontPrice :: Maybe Text
tags :: Maybe [Tag]
state :: Maybe ReservationState
start :: Maybe ISO8601
paymentOption :: Maybe PaymentOption
offeringId :: Maybe Text
instanceFamily :: Maybe Text
hourlyPrice :: Maybe Text
hostReservationId :: Maybe Text
hostIdSet :: Maybe [Text]
end :: Maybe ISO8601
duration :: Maybe Int
currencyCode :: Maybe CurrencyCodeValues
count :: Maybe Int
$sel:upfrontPrice:HostReservation' :: HostReservation -> Maybe Text
$sel:tags:HostReservation' :: HostReservation -> Maybe [Tag]
$sel:state:HostReservation' :: HostReservation -> Maybe ReservationState
$sel:start:HostReservation' :: HostReservation -> Maybe ISO8601
$sel:paymentOption:HostReservation' :: HostReservation -> Maybe PaymentOption
$sel:offeringId:HostReservation' :: HostReservation -> Maybe Text
$sel:instanceFamily:HostReservation' :: HostReservation -> Maybe Text
$sel:hourlyPrice:HostReservation' :: HostReservation -> Maybe Text
$sel:hostReservationId:HostReservation' :: HostReservation -> Maybe Text
$sel:hostIdSet:HostReservation' :: HostReservation -> Maybe [Text]
$sel:end:HostReservation' :: HostReservation -> Maybe ISO8601
$sel:duration:HostReservation' :: HostReservation -> Maybe Int
$sel:currencyCode:HostReservation' :: HostReservation -> Maybe CurrencyCodeValues
$sel:count:HostReservation' :: HostReservation -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
count
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CurrencyCodeValues
currencyCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
duration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
end
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
hostIdSet
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hostReservationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hourlyPrice
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceFamily
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
offeringId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PaymentOption
paymentOption
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
start
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReservationState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
upfrontPrice

instance Prelude.NFData HostReservation where
  rnf :: HostReservation -> ()
rnf HostReservation' {Maybe Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Maybe ISO8601
Maybe CurrencyCodeValues
Maybe PaymentOption
Maybe ReservationState
upfrontPrice :: Maybe Text
tags :: Maybe [Tag]
state :: Maybe ReservationState
start :: Maybe ISO8601
paymentOption :: Maybe PaymentOption
offeringId :: Maybe Text
instanceFamily :: Maybe Text
hourlyPrice :: Maybe Text
hostReservationId :: Maybe Text
hostIdSet :: Maybe [Text]
end :: Maybe ISO8601
duration :: Maybe Int
currencyCode :: Maybe CurrencyCodeValues
count :: Maybe Int
$sel:upfrontPrice:HostReservation' :: HostReservation -> Maybe Text
$sel:tags:HostReservation' :: HostReservation -> Maybe [Tag]
$sel:state:HostReservation' :: HostReservation -> Maybe ReservationState
$sel:start:HostReservation' :: HostReservation -> Maybe ISO8601
$sel:paymentOption:HostReservation' :: HostReservation -> Maybe PaymentOption
$sel:offeringId:HostReservation' :: HostReservation -> Maybe Text
$sel:instanceFamily:HostReservation' :: HostReservation -> Maybe Text
$sel:hourlyPrice:HostReservation' :: HostReservation -> Maybe Text
$sel:hostReservationId:HostReservation' :: HostReservation -> Maybe Text
$sel:hostIdSet:HostReservation' :: HostReservation -> Maybe [Text]
$sel:end:HostReservation' :: HostReservation -> Maybe ISO8601
$sel:duration:HostReservation' :: HostReservation -> Maybe Int
$sel:currencyCode:HostReservation' :: HostReservation -> Maybe CurrencyCodeValues
$sel:count:HostReservation' :: HostReservation -> Maybe Int
..} =
    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 CurrencyCodeValues
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 ISO8601
end
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
hostIdSet
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hostReservationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hourlyPrice
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceFamily
      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 PaymentOption
paymentOption
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
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 [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
upfrontPrice