{-# 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.MediaConnect.Types.Offering where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.DurationUnits
import Amazonka.MediaConnect.Types.PriceUnits
import Amazonka.MediaConnect.Types.ResourceSpecification
import qualified Amazonka.Prelude as Prelude
data Offering = Offering'
{
Offering -> Text
currencyCode :: Prelude.Text,
Offering -> Text
offeringArn :: Prelude.Text,
Offering -> Text
offeringDescription :: Prelude.Text,
Offering -> DurationUnits
durationUnits :: DurationUnits,
Offering -> Int
duration :: Prelude.Int,
Offering -> Text
pricePerUnit :: Prelude.Text,
Offering -> ResourceSpecification
resourceSpecification :: ResourceSpecification,
Offering -> PriceUnits
priceUnits :: PriceUnits
}
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 ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DurationUnits ->
Prelude.Int ->
Prelude.Text ->
ResourceSpecification ->
PriceUnits ->
Offering
newOffering :: Text
-> Text
-> Text
-> DurationUnits
-> Int
-> Text
-> ResourceSpecification
-> PriceUnits
-> Offering
newOffering
Text
pCurrencyCode_
Text
pOfferingArn_
Text
pOfferingDescription_
DurationUnits
pDurationUnits_
Int
pDuration_
Text
pPricePerUnit_
ResourceSpecification
pResourceSpecification_
PriceUnits
pPriceUnits_ =
Offering' :: Text
-> Text
-> Text
-> DurationUnits
-> Int
-> Text
-> ResourceSpecification
-> PriceUnits
-> Offering
Offering'
{ $sel:currencyCode:Offering' :: Text
currencyCode = Text
pCurrencyCode_,
$sel:offeringArn:Offering' :: Text
offeringArn = Text
pOfferingArn_,
$sel:offeringDescription:Offering' :: Text
offeringDescription = Text
pOfferingDescription_,
$sel:durationUnits:Offering' :: DurationUnits
durationUnits = DurationUnits
pDurationUnits_,
$sel:duration:Offering' :: Int
duration = Int
pDuration_,
$sel:pricePerUnit:Offering' :: Text
pricePerUnit = Text
pPricePerUnit_,
$sel:resourceSpecification:Offering' :: ResourceSpecification
resourceSpecification = ResourceSpecification
pResourceSpecification_,
$sel:priceUnits:Offering' :: PriceUnits
priceUnits = PriceUnits
pPriceUnits_
}
offering_currencyCode :: Lens.Lens' Offering Prelude.Text
offering_currencyCode :: (Text -> f Text) -> Offering -> f Offering
offering_currencyCode = (Offering -> Text)
-> (Offering -> Text -> Offering)
-> Lens Offering Offering Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Text
currencyCode :: Text
$sel:currencyCode:Offering' :: Offering -> Text
currencyCode} -> Text
currencyCode) (\s :: Offering
s@Offering' {} Text
a -> Offering
s {$sel:currencyCode:Offering' :: Text
currencyCode = Text
a} :: Offering)
offering_offeringArn :: Lens.Lens' Offering Prelude.Text
offering_offeringArn :: (Text -> f Text) -> Offering -> f Offering
offering_offeringArn = (Offering -> Text)
-> (Offering -> Text -> Offering)
-> Lens Offering Offering Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Text
offeringArn :: Text
$sel:offeringArn:Offering' :: Offering -> Text
offeringArn} -> Text
offeringArn) (\s :: Offering
s@Offering' {} Text
a -> Offering
s {$sel:offeringArn:Offering' :: Text
offeringArn = Text
a} :: Offering)
offering_offeringDescription :: Lens.Lens' Offering Prelude.Text
offering_offeringDescription :: (Text -> f Text) -> Offering -> f Offering
offering_offeringDescription = (Offering -> Text)
-> (Offering -> Text -> Offering)
-> Lens Offering Offering Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Text
offeringDescription :: Text
$sel:offeringDescription:Offering' :: Offering -> Text
offeringDescription} -> Text
offeringDescription) (\s :: Offering
s@Offering' {} Text
a -> Offering
s {$sel:offeringDescription:Offering' :: Text
offeringDescription = Text
a} :: Offering)
offering_durationUnits :: Lens.Lens' Offering DurationUnits
offering_durationUnits :: (DurationUnits -> f DurationUnits) -> Offering -> f Offering
offering_durationUnits = (Offering -> DurationUnits)
-> (Offering -> DurationUnits -> Offering)
-> Lens Offering Offering DurationUnits DurationUnits
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {DurationUnits
durationUnits :: DurationUnits
$sel:durationUnits:Offering' :: Offering -> DurationUnits
durationUnits} -> DurationUnits
durationUnits) (\s :: Offering
s@Offering' {} DurationUnits
a -> Offering
s {$sel:durationUnits:Offering' :: DurationUnits
durationUnits = DurationUnits
a} :: Offering)
offering_duration :: Lens.Lens' Offering Prelude.Int
offering_duration :: (Int -> f Int) -> Offering -> f Offering
offering_duration = (Offering -> Int)
-> (Offering -> Int -> Offering) -> Lens Offering Offering Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Int
duration :: Int
$sel:duration:Offering' :: Offering -> Int
duration} -> Int
duration) (\s :: Offering
s@Offering' {} Int
a -> Offering
s {$sel:duration:Offering' :: Int
duration = Int
a} :: Offering)
offering_pricePerUnit :: Lens.Lens' Offering Prelude.Text
offering_pricePerUnit :: (Text -> f Text) -> Offering -> f Offering
offering_pricePerUnit = (Offering -> Text)
-> (Offering -> Text -> Offering)
-> Lens Offering Offering Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {Text
pricePerUnit :: Text
$sel:pricePerUnit:Offering' :: Offering -> Text
pricePerUnit} -> Text
pricePerUnit) (\s :: Offering
s@Offering' {} Text
a -> Offering
s {$sel:pricePerUnit:Offering' :: Text
pricePerUnit = Text
a} :: Offering)
offering_resourceSpecification :: Lens.Lens' Offering ResourceSpecification
offering_resourceSpecification :: (ResourceSpecification -> f ResourceSpecification)
-> Offering -> f Offering
offering_resourceSpecification = (Offering -> ResourceSpecification)
-> (Offering -> ResourceSpecification -> Offering)
-> Lens
Offering Offering ResourceSpecification ResourceSpecification
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {ResourceSpecification
resourceSpecification :: ResourceSpecification
$sel:resourceSpecification:Offering' :: Offering -> ResourceSpecification
resourceSpecification} -> ResourceSpecification
resourceSpecification) (\s :: Offering
s@Offering' {} ResourceSpecification
a -> Offering
s {$sel:resourceSpecification:Offering' :: ResourceSpecification
resourceSpecification = ResourceSpecification
a} :: Offering)
offering_priceUnits :: Lens.Lens' Offering PriceUnits
offering_priceUnits :: (PriceUnits -> f PriceUnits) -> Offering -> f Offering
offering_priceUnits = (Offering -> PriceUnits)
-> (Offering -> PriceUnits -> Offering)
-> Lens Offering Offering PriceUnits PriceUnits
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Offering' {PriceUnits
priceUnits :: PriceUnits
$sel:priceUnits:Offering' :: Offering -> PriceUnits
priceUnits} -> PriceUnits
priceUnits) (\s :: Offering
s@Offering' {} PriceUnits
a -> Offering
s {$sel:priceUnits:Offering' :: PriceUnits
priceUnits = PriceUnits
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 ->
Text
-> Text
-> Text
-> DurationUnits
-> Int
-> Text
-> ResourceSpecification
-> PriceUnits
-> Offering
Offering'
(Text
-> Text
-> Text
-> DurationUnits
-> Int
-> Text
-> ResourceSpecification
-> PriceUnits
-> Offering)
-> Parser Text
-> Parser
(Text
-> Text
-> DurationUnits
-> Int
-> Text
-> ResourceSpecification
-> PriceUnits
-> Offering)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"currencyCode")
Parser
(Text
-> Text
-> DurationUnits
-> Int
-> Text
-> ResourceSpecification
-> PriceUnits
-> Offering)
-> Parser Text
-> Parser
(Text
-> DurationUnits
-> Int
-> Text
-> ResourceSpecification
-> PriceUnits
-> Offering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"offeringArn")
Parser
(Text
-> DurationUnits
-> Int
-> Text
-> ResourceSpecification
-> PriceUnits
-> Offering)
-> Parser Text
-> Parser
(DurationUnits
-> Int -> Text -> ResourceSpecification -> PriceUnits -> Offering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"offeringDescription")
Parser
(DurationUnits
-> Int -> Text -> ResourceSpecification -> PriceUnits -> Offering)
-> Parser DurationUnits
-> Parser
(Int -> Text -> ResourceSpecification -> PriceUnits -> Offering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DurationUnits
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"durationUnits")
Parser
(Int -> Text -> ResourceSpecification -> PriceUnits -> Offering)
-> Parser Int
-> Parser (Text -> ResourceSpecification -> PriceUnits -> Offering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"duration")
Parser (Text -> ResourceSpecification -> PriceUnits -> Offering)
-> Parser Text
-> Parser (ResourceSpecification -> PriceUnits -> Offering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"pricePerUnit")
Parser (ResourceSpecification -> PriceUnits -> Offering)
-> Parser ResourceSpecification -> Parser (PriceUnits -> Offering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ResourceSpecification
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"resourceSpecification")
Parser (PriceUnits -> Offering)
-> Parser PriceUnits -> Parser Offering
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser PriceUnits
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"priceUnits")
)
instance Prelude.Hashable Offering
instance Prelude.NFData Offering