{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.MediaLive.Types.Offering 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.ReservationResourceSpecification
import qualified Amazonka.Prelude as Prelude
data Offering = Offering'
{
Offering -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Offering -> Maybe Text
currencyCode :: Prelude.Maybe Prelude.Text,
Offering -> Maybe Int
duration :: Prelude.Maybe Prelude.Int,
Offering -> Maybe OfferingDurationUnits
durationUnits :: Prelude.Maybe OfferingDurationUnits,
Offering -> Maybe Double
fixedPrice :: Prelude.Maybe Prelude.Double,
Offering -> Maybe Text
offeringDescription :: Prelude.Maybe Prelude.Text,
Offering -> Maybe Text
offeringId :: Prelude.Maybe Prelude.Text,
Offering -> Maybe OfferingType
offeringType :: Prelude.Maybe OfferingType,
Offering -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
Offering -> Maybe ReservationResourceSpecification
resourceSpecification :: Prelude.Maybe ReservationResourceSpecification,
Offering -> Maybe Double
usagePrice :: Prelude.Maybe Prelude.Double
}
deriving (Offering -> Offering -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Offering -> Offering -> Bool
$c/= :: Offering -> Offering -> Bool
== :: Offering -> Offering -> Bool
$c== :: Offering -> Offering -> Bool
Prelude.Eq, ReadPrec [Offering]
ReadPrec Offering
Int -> ReadS Offering
ReadS [Offering]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Offering]
$creadListPrec :: ReadPrec [Offering]
readPrec :: ReadPrec Offering
$creadPrec :: ReadPrec Offering
readList :: ReadS [Offering]
$creadList :: ReadS [Offering]
readsPrec :: Int -> ReadS Offering
$creadsPrec :: Int -> ReadS Offering
Prelude.Read, Int -> Offering -> ShowS
[Offering] -> ShowS
Offering -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Offering] -> ShowS
$cshowList :: [Offering] -> ShowS
show :: Offering -> String
$cshow :: Offering -> String
showsPrec :: Int -> Offering -> ShowS
$cshowsPrec :: Int -> Offering -> ShowS
Prelude.Show, forall x. Rep Offering x -> Offering
forall x. Offering -> Rep Offering x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Offering x -> Offering
$cfrom :: forall x. Offering -> Rep Offering x
Prelude.Generic)
newOffering ::
Offering
newOffering :: Offering
newOffering =
Offering'
{ $sel:arn:Offering' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:currencyCode:Offering' :: Maybe Text
currencyCode = forall a. Maybe a
Prelude.Nothing,
$sel:duration:Offering' :: Maybe Int
duration = forall a. Maybe a
Prelude.Nothing,
$sel:durationUnits:Offering' :: Maybe OfferingDurationUnits
durationUnits = forall a. Maybe a
Prelude.Nothing,
$sel:fixedPrice:Offering' :: Maybe Double
fixedPrice = forall a. Maybe a
Prelude.Nothing,
$sel:offeringDescription:Offering' :: Maybe Text
offeringDescription = forall a. Maybe a
Prelude.Nothing,
$sel:offeringId:Offering' :: Maybe Text
offeringId = forall a. Maybe a
Prelude.Nothing,
$sel:offeringType:Offering' :: Maybe OfferingType
offeringType = forall a. Maybe a
Prelude.Nothing,
$sel:region:Offering' :: Maybe Text
region = forall a. Maybe a
Prelude.Nothing,
$sel:resourceSpecification:Offering' :: Maybe ReservationResourceSpecification
resourceSpecification = forall a. Maybe a
Prelude.Nothing,
$sel:usagePrice:Offering' :: Maybe Double
usagePrice = forall a. Maybe a
Prelude.Nothing
}
offering_arn :: Lens.Lens' Offering (Prelude.Maybe Prelude.Text)
offering_arn :: Lens' Offering (Maybe Text)
offering_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Maybe Text
arn :: Maybe Text
$sel:arn:Offering' :: Offering -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Offering
s@Offering' {} Maybe Text
a -> Offering
s {$sel:arn:Offering' :: Maybe Text
arn = Maybe Text
a} :: Offering)
offering_currencyCode :: Lens.Lens' Offering (Prelude.Maybe Prelude.Text)
offering_currencyCode :: Lens' Offering (Maybe Text)
offering_currencyCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Maybe Text
currencyCode :: Maybe Text
$sel:currencyCode:Offering' :: Offering -> Maybe Text
currencyCode} -> Maybe Text
currencyCode) (\s :: Offering
s@Offering' {} Maybe Text
a -> Offering
s {$sel:currencyCode:Offering' :: Maybe Text
currencyCode = Maybe Text
a} :: Offering)
offering_duration :: Lens.Lens' Offering (Prelude.Maybe Prelude.Int)
offering_duration :: Lens' Offering (Maybe Int)
offering_duration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Maybe Int
duration :: Maybe Int
$sel:duration:Offering' :: Offering -> Maybe Int
duration} -> Maybe Int
duration) (\s :: Offering
s@Offering' {} Maybe Int
a -> Offering
s {$sel:duration:Offering' :: Maybe Int
duration = Maybe Int
a} :: Offering)
offering_durationUnits :: Lens.Lens' Offering (Prelude.Maybe OfferingDurationUnits)
offering_durationUnits :: Lens' Offering (Maybe OfferingDurationUnits)
offering_durationUnits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Maybe OfferingDurationUnits
durationUnits :: Maybe OfferingDurationUnits
$sel:durationUnits:Offering' :: Offering -> Maybe OfferingDurationUnits
durationUnits} -> Maybe OfferingDurationUnits
durationUnits) (\s :: Offering
s@Offering' {} Maybe OfferingDurationUnits
a -> Offering
s {$sel:durationUnits:Offering' :: Maybe OfferingDurationUnits
durationUnits = Maybe OfferingDurationUnits
a} :: Offering)
offering_fixedPrice :: Lens.Lens' Offering (Prelude.Maybe Prelude.Double)
offering_fixedPrice :: Lens' Offering (Maybe Double)
offering_fixedPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Maybe Double
fixedPrice :: Maybe Double
$sel:fixedPrice:Offering' :: Offering -> Maybe Double
fixedPrice} -> Maybe Double
fixedPrice) (\s :: Offering
s@Offering' {} Maybe Double
a -> Offering
s {$sel:fixedPrice:Offering' :: Maybe Double
fixedPrice = Maybe Double
a} :: Offering)
offering_offeringDescription :: Lens.Lens' Offering (Prelude.Maybe Prelude.Text)
offering_offeringDescription :: Lens' Offering (Maybe Text)
offering_offeringDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Maybe Text
offeringDescription :: Maybe Text
$sel:offeringDescription:Offering' :: Offering -> Maybe Text
offeringDescription} -> Maybe Text
offeringDescription) (\s :: Offering
s@Offering' {} Maybe Text
a -> Offering
s {$sel:offeringDescription:Offering' :: Maybe Text
offeringDescription = Maybe Text
a} :: Offering)
offering_offeringId :: Lens.Lens' Offering (Prelude.Maybe Prelude.Text)
offering_offeringId :: Lens' Offering (Maybe Text)
offering_offeringId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Maybe Text
offeringId :: Maybe Text
$sel:offeringId:Offering' :: Offering -> Maybe Text
offeringId} -> Maybe Text
offeringId) (\s :: Offering
s@Offering' {} Maybe Text
a -> Offering
s {$sel:offeringId:Offering' :: Maybe Text
offeringId = Maybe Text
a} :: Offering)
offering_offeringType :: Lens.Lens' Offering (Prelude.Maybe OfferingType)
offering_offeringType :: Lens' Offering (Maybe OfferingType)
offering_offeringType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Maybe OfferingType
offeringType :: Maybe OfferingType
$sel:offeringType:Offering' :: Offering -> Maybe OfferingType
offeringType} -> Maybe OfferingType
offeringType) (\s :: Offering
s@Offering' {} Maybe OfferingType
a -> Offering
s {$sel:offeringType:Offering' :: Maybe OfferingType
offeringType = Maybe OfferingType
a} :: Offering)
offering_region :: Lens.Lens' Offering (Prelude.Maybe Prelude.Text)
offering_region :: Lens' Offering (Maybe Text)
offering_region = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Maybe Text
region :: Maybe Text
$sel:region:Offering' :: Offering -> Maybe Text
region} -> Maybe Text
region) (\s :: Offering
s@Offering' {} Maybe Text
a -> Offering
s {$sel:region:Offering' :: Maybe Text
region = Maybe Text
a} :: Offering)
offering_resourceSpecification :: Lens.Lens' Offering (Prelude.Maybe ReservationResourceSpecification)
offering_resourceSpecification :: Lens' Offering (Maybe ReservationResourceSpecification)
offering_resourceSpecification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Maybe ReservationResourceSpecification
resourceSpecification :: Maybe ReservationResourceSpecification
$sel:resourceSpecification:Offering' :: Offering -> Maybe ReservationResourceSpecification
resourceSpecification} -> Maybe ReservationResourceSpecification
resourceSpecification) (\s :: Offering
s@Offering' {} Maybe ReservationResourceSpecification
a -> Offering
s {$sel:resourceSpecification:Offering' :: Maybe ReservationResourceSpecification
resourceSpecification = Maybe ReservationResourceSpecification
a} :: Offering)
offering_usagePrice :: Lens.Lens' Offering (Prelude.Maybe Prelude.Double)
offering_usagePrice :: Lens' Offering (Maybe Double)
offering_usagePrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Maybe Double
usagePrice :: Maybe Double
$sel:usagePrice:Offering' :: Offering -> Maybe Double
usagePrice} -> Maybe Double
usagePrice) (\s :: Offering
s@Offering' {} Maybe Double
a -> Offering
s {$sel:usagePrice:Offering' :: Maybe Double
usagePrice = Maybe Double
a} :: Offering)
instance Data.FromJSON Offering where
parseJSON :: Value -> Parser Offering
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Offering"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe OfferingDurationUnits
-> Maybe Double
-> Maybe Text
-> Maybe Text
-> Maybe OfferingType
-> Maybe Text
-> Maybe ReservationResourceSpecification
-> Maybe Double
-> Offering
Offering'
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
"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
"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
"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
"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
"usagePrice")
)
instance Prelude.Hashable Offering where
hashWithSalt :: Int -> Offering -> Int
hashWithSalt Int
_salt Offering' {Maybe Double
Maybe Int
Maybe Text
Maybe OfferingDurationUnits
Maybe OfferingType
Maybe ReservationResourceSpecification
usagePrice :: Maybe Double
resourceSpecification :: Maybe ReservationResourceSpecification
region :: Maybe Text
offeringType :: Maybe OfferingType
offeringId :: Maybe Text
offeringDescription :: Maybe Text
fixedPrice :: Maybe Double
durationUnits :: Maybe OfferingDurationUnits
duration :: Maybe Int
currencyCode :: Maybe Text
arn :: Maybe Text
$sel:usagePrice:Offering' :: Offering -> Maybe Double
$sel:resourceSpecification:Offering' :: Offering -> Maybe ReservationResourceSpecification
$sel:region:Offering' :: Offering -> Maybe Text
$sel:offeringType:Offering' :: Offering -> Maybe OfferingType
$sel:offeringId:Offering' :: Offering -> Maybe Text
$sel:offeringDescription:Offering' :: Offering -> Maybe Text
$sel:fixedPrice:Offering' :: Offering -> Maybe Double
$sel:durationUnits:Offering' :: Offering -> Maybe OfferingDurationUnits
$sel:duration:Offering' :: Offering -> Maybe Int
$sel:currencyCode:Offering' :: Offering -> Maybe Text
$sel:arn:Offering' :: Offering -> 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 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 Double
fixedPrice
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 ReservationResourceSpecification
resourceSpecification
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
usagePrice
instance Prelude.NFData Offering where
rnf :: Offering -> ()
rnf Offering' {Maybe Double
Maybe Int
Maybe Text
Maybe OfferingDurationUnits
Maybe OfferingType
Maybe ReservationResourceSpecification
usagePrice :: Maybe Double
resourceSpecification :: Maybe ReservationResourceSpecification
region :: Maybe Text
offeringType :: Maybe OfferingType
offeringId :: Maybe Text
offeringDescription :: Maybe Text
fixedPrice :: Maybe Double
durationUnits :: Maybe OfferingDurationUnits
duration :: Maybe Int
currencyCode :: Maybe Text
arn :: Maybe Text
$sel:usagePrice:Offering' :: Offering -> Maybe Double
$sel:resourceSpecification:Offering' :: Offering -> Maybe ReservationResourceSpecification
$sel:region:Offering' :: Offering -> Maybe Text
$sel:offeringType:Offering' :: Offering -> Maybe OfferingType
$sel:offeringId:Offering' :: Offering -> Maybe Text
$sel:offeringDescription:Offering' :: Offering -> Maybe Text
$sel:fixedPrice:Offering' :: Offering -> Maybe Double
$sel:durationUnits:Offering' :: Offering -> Maybe OfferingDurationUnits
$sel:duration:Offering' :: Offering -> Maybe Int
$sel:currencyCode:Offering' :: Offering -> Maybe Text
$sel:arn:Offering' :: Offering -> 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 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 Double
fixedPrice
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 ReservationResourceSpecification
resourceSpecification
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
usagePrice