{-# 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.Lens as Lens
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 ReservationResourceSpecification
resourceSpecification :: Prelude.Maybe ReservationResourceSpecification,
Offering -> Maybe Text
currencyCode :: Prelude.Maybe Prelude.Text,
Offering -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Offering -> Maybe Text
offeringId :: Prelude.Maybe Prelude.Text,
Offering -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
Offering -> Maybe OfferingType
offeringType :: Prelude.Maybe OfferingType,
Offering -> Maybe Double
usagePrice :: Prelude.Maybe Prelude.Double,
Offering -> Maybe Double
fixedPrice :: Prelude.Maybe Prelude.Double,
Offering -> Maybe OfferingDurationUnits
durationUnits :: Prelude.Maybe OfferingDurationUnits,
Offering -> Maybe Text
offeringDescription :: Prelude.Maybe Prelude.Text,
Offering -> Maybe Int
duration :: Prelude.Maybe Prelude.Int
}
deriving (Offering -> Offering -> Bool
(Offering -> Offering -> Bool)
-> (Offering -> Offering -> Bool) -> Eq Offering
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]
(Int -> ReadS Offering)
-> ReadS [Offering]
-> ReadPrec Offering
-> ReadPrec [Offering]
-> Read 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
(Int -> Offering -> ShowS)
-> (Offering -> String) -> ([Offering] -> ShowS) -> Show Offering
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. Offering -> Rep Offering x)
-> (forall x. Rep Offering x -> Offering) -> Generic Offering
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' :: Maybe ReservationResourceSpecification
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe OfferingType
-> Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Offering
Offering'
{ $sel:resourceSpecification:Offering' :: Maybe ReservationResourceSpecification
resourceSpecification = Maybe ReservationResourceSpecification
forall a. Maybe a
Prelude.Nothing,
$sel:currencyCode:Offering' :: Maybe Text
currencyCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Offering' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:offeringId:Offering' :: Maybe Text
offeringId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:region:Offering' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:offeringType:Offering' :: Maybe OfferingType
offeringType = Maybe OfferingType
forall a. Maybe a
Prelude.Nothing,
$sel:usagePrice:Offering' :: Maybe Double
usagePrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:fixedPrice:Offering' :: Maybe Double
fixedPrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:durationUnits:Offering' :: Maybe OfferingDurationUnits
durationUnits = Maybe OfferingDurationUnits
forall a. Maybe a
Prelude.Nothing,
$sel:offeringDescription:Offering' :: Maybe Text
offeringDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:duration:Offering' :: Maybe Int
duration = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
offering_resourceSpecification :: Lens.Lens' Offering (Prelude.Maybe ReservationResourceSpecification)
offering_resourceSpecification :: (Maybe ReservationResourceSpecification
-> f (Maybe ReservationResourceSpecification))
-> Offering -> f Offering
offering_resourceSpecification = (Offering -> Maybe ReservationResourceSpecification)
-> (Offering -> Maybe ReservationResourceSpecification -> Offering)
-> Lens
Offering
Offering
(Maybe ReservationResourceSpecification)
(Maybe ReservationResourceSpecification)
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_currencyCode :: Lens.Lens' Offering (Prelude.Maybe Prelude.Text)
offering_currencyCode :: (Maybe Text -> f (Maybe Text)) -> Offering -> f Offering
offering_currencyCode = (Offering -> Maybe Text)
-> (Offering -> Maybe Text -> Offering)
-> Lens Offering Offering (Maybe Text) (Maybe Text)
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_arn :: Lens.Lens' Offering (Prelude.Maybe Prelude.Text)
offering_arn :: (Maybe Text -> f (Maybe Text)) -> Offering -> f Offering
offering_arn = (Offering -> Maybe Text)
-> (Offering -> Maybe Text -> Offering)
-> Lens Offering Offering (Maybe Text) (Maybe Text)
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_offeringId :: Lens.Lens' Offering (Prelude.Maybe Prelude.Text)
offering_offeringId :: (Maybe Text -> f (Maybe Text)) -> Offering -> f Offering
offering_offeringId = (Offering -> Maybe Text)
-> (Offering -> Maybe Text -> Offering)
-> Lens Offering Offering (Maybe Text) (Maybe Text)
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_region :: Lens.Lens' Offering (Prelude.Maybe Prelude.Text)
offering_region :: (Maybe Text -> f (Maybe Text)) -> Offering -> f Offering
offering_region = (Offering -> Maybe Text)
-> (Offering -> Maybe Text -> Offering)
-> Lens Offering Offering (Maybe Text) (Maybe Text)
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_offeringType :: Lens.Lens' Offering (Prelude.Maybe OfferingType)
offering_offeringType :: (Maybe OfferingType -> f (Maybe OfferingType))
-> Offering -> f Offering
offering_offeringType = (Offering -> Maybe OfferingType)
-> (Offering -> Maybe OfferingType -> Offering)
-> Lens Offering Offering (Maybe OfferingType) (Maybe 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_usagePrice :: Lens.Lens' Offering (Prelude.Maybe Prelude.Double)
offering_usagePrice :: (Maybe Double -> f (Maybe Double)) -> Offering -> f Offering
offering_usagePrice = (Offering -> Maybe Double)
-> (Offering -> Maybe Double -> Offering)
-> Lens Offering Offering (Maybe Double) (Maybe Double)
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)
offering_fixedPrice :: Lens.Lens' Offering (Prelude.Maybe Prelude.Double)
offering_fixedPrice :: (Maybe Double -> f (Maybe Double)) -> Offering -> f Offering
offering_fixedPrice = (Offering -> Maybe Double)
-> (Offering -> Maybe Double -> Offering)
-> Lens Offering Offering (Maybe Double) (Maybe Double)
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_durationUnits :: Lens.Lens' Offering (Prelude.Maybe OfferingDurationUnits)
offering_durationUnits :: (Maybe OfferingDurationUnits -> f (Maybe OfferingDurationUnits))
-> Offering -> f Offering
offering_durationUnits = (Offering -> Maybe OfferingDurationUnits)
-> (Offering -> Maybe OfferingDurationUnits -> Offering)
-> Lens
Offering
Offering
(Maybe OfferingDurationUnits)
(Maybe OfferingDurationUnits)
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_offeringDescription :: Lens.Lens' Offering (Prelude.Maybe Prelude.Text)
offering_offeringDescription :: (Maybe Text -> f (Maybe Text)) -> Offering -> f Offering
offering_offeringDescription = (Offering -> Maybe Text)
-> (Offering -> Maybe Text -> Offering)
-> Lens Offering Offering (Maybe Text) (Maybe Text)
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_duration :: Lens.Lens' Offering (Prelude.Maybe Prelude.Int)
offering_duration :: (Maybe Int -> f (Maybe Int)) -> Offering -> f Offering
offering_duration = (Offering -> Maybe Int)
-> (Offering -> Maybe Int -> Offering)
-> Lens Offering Offering (Maybe Int) (Maybe Int)
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)
instance Core.FromJSON Offering where
parseJSON :: Value -> Parser Offering
parseJSON =
String -> (Object -> Parser Offering) -> Value -> Parser Offering
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Offering"
( \Object
x ->
Maybe ReservationResourceSpecification
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe OfferingType
-> Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Offering
Offering'
(Maybe ReservationResourceSpecification
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe OfferingType
-> Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Offering)
-> Parser (Maybe ReservationResourceSpecification)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe OfferingType
-> Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Offering)
forall (f :: * -> *) a b. Functor 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 Text
-> Maybe OfferingType
-> Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Offering)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe OfferingType
-> Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Offering)
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 Text
-> Maybe OfferingType
-> Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Offering)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe OfferingType
-> Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Offering)
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 Text
-> Maybe OfferingType
-> Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Offering)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe OfferingType
-> Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Offering)
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
-> Offering)
-> Parser (Maybe Text)
-> Parser
(Maybe OfferingType
-> Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Offering)
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
-> Offering)
-> Parser (Maybe OfferingType)
-> Parser
(Maybe Double
-> Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Offering)
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
-> Offering)
-> Parser (Maybe Double)
-> Parser
(Maybe Double
-> Maybe OfferingDurationUnits
-> Maybe Text
-> Maybe Int
-> Offering)
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
-> Offering)
-> Parser (Maybe Double)
-> Parser
(Maybe OfferingDurationUnits
-> Maybe Text -> Maybe Int -> Offering)
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 -> Offering)
-> Parser (Maybe OfferingDurationUnits)
-> Parser (Maybe Text -> Maybe Int -> Offering)
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 -> Offering)
-> Parser (Maybe Text) -> Parser (Maybe Int -> Offering)
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 -> Offering)
-> Parser (Maybe Int) -> Parser Offering
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")
)
instance Prelude.Hashable Offering
instance Prelude.NFData Offering