{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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 ::
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'
{ $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 :: Lens' Offering Text
offering_currencyCode = 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 :: Lens' Offering Text
offering_offeringArn = 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 :: Lens' Offering Text
offering_offeringDescription = 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 :: Lens' Offering DurationUnits
offering_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 :: Lens' Offering Int
offering_duration = 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 :: Lens' Offering Text
offering_pricePerUnit = 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 :: Lens' Offering ResourceSpecification
offering_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 :: Lens' Offering PriceUnits
offering_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 Data.FromJSON Offering where
parseJSON :: Value -> Parser Offering
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Offering"
( \Object
x ->
Text
-> Text
-> Text
-> DurationUnits
-> Int
-> Text
-> ResourceSpecification
-> PriceUnits
-> Offering
Offering'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 a
Data..: Key
"offeringArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 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 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 a
Data..: Key
"pricePerUnit")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 a
Data..: Key
"priceUnits")
)
instance Prelude.Hashable Offering where
hashWithSalt :: Int -> Offering -> Int
hashWithSalt Int
_salt Offering' {Int
Text
DurationUnits
PriceUnits
ResourceSpecification
priceUnits :: PriceUnits
resourceSpecification :: ResourceSpecification
pricePerUnit :: Text
duration :: Int
durationUnits :: DurationUnits
offeringDescription :: Text
offeringArn :: Text
currencyCode :: Text
$sel:priceUnits:Offering' :: Offering -> PriceUnits
$sel:resourceSpecification:Offering' :: Offering -> ResourceSpecification
$sel:pricePerUnit:Offering' :: Offering -> Text
$sel:duration:Offering' :: Offering -> Int
$sel:durationUnits:Offering' :: Offering -> DurationUnits
$sel:offeringDescription:Offering' :: Offering -> Text
$sel:offeringArn:Offering' :: Offering -> Text
$sel:currencyCode:Offering' :: Offering -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
currencyCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
offeringArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
offeringDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DurationUnits
durationUnits
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
duration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
pricePerUnit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResourceSpecification
resourceSpecification
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PriceUnits
priceUnits
instance Prelude.NFData Offering where
rnf :: Offering -> ()
rnf Offering' {Int
Text
DurationUnits
PriceUnits
ResourceSpecification
priceUnits :: PriceUnits
resourceSpecification :: ResourceSpecification
pricePerUnit :: Text
duration :: Int
durationUnits :: DurationUnits
offeringDescription :: Text
offeringArn :: Text
currencyCode :: Text
$sel:priceUnits:Offering' :: Offering -> PriceUnits
$sel:resourceSpecification:Offering' :: Offering -> ResourceSpecification
$sel:pricePerUnit:Offering' :: Offering -> Text
$sel:duration:Offering' :: Offering -> Int
$sel:durationUnits:Offering' :: Offering -> DurationUnits
$sel:offeringDescription:Offering' :: Offering -> Text
$sel:offeringArn:Offering' :: Offering -> Text
$sel:currencyCode:Offering' :: Offering -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
currencyCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
offeringArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
offeringDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DurationUnits
durationUnits
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
duration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
pricePerUnit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ResourceSpecification
resourceSpecification
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PriceUnits
priceUnits