{-# 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.MediaLive.Types.Offering
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Reserved resources available for purchase
--
-- /See:/ 'newOffering' smart constructor.
data Offering = Offering'
  { -- | Resource configuration details
    Offering -> Maybe ReservationResourceSpecification
resourceSpecification :: Prelude.Maybe ReservationResourceSpecification,
    -- | Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g.
    -- \'USD\'
    Offering -> Maybe Text
currencyCode :: Prelude.Maybe Prelude.Text,
    -- | Unique offering ARN, e.g.
    -- \'arn:aws:medialive:us-west-2:123456789012:offering:87654321\'
    Offering -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Unique offering ID, e.g. \'87654321\'
    Offering -> Maybe Text
offeringId :: Prelude.Maybe Prelude.Text,
    -- | AWS region, e.g. \'us-west-2\'
    Offering -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | Offering type, e.g. \'NO_UPFRONT\'
    Offering -> Maybe OfferingType
offeringType :: Prelude.Maybe OfferingType,
    -- | Recurring usage charge for each reserved resource, e.g. \'157.0\'
    Offering -> Maybe Double
usagePrice :: Prelude.Maybe Prelude.Double,
    -- | One-time charge for each reserved resource, e.g. \'0.0\' for a
    -- NO_UPFRONT offering
    Offering -> Maybe Double
fixedPrice :: Prelude.Maybe Prelude.Double,
    -- | Units for duration, e.g. \'MONTHS\'
    Offering -> Maybe OfferingDurationUnits
durationUnits :: Prelude.Maybe OfferingDurationUnits,
    -- | Offering description, e.g. \'HD AVC output at 10-20 Mbps, 30 fps, and
    -- standard VQ in US West (Oregon)\'
    Offering -> Maybe Text
offeringDescription :: Prelude.Maybe Prelude.Text,
    -- | Lease duration, e.g. \'12\'
    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)

-- |
-- Create a value of 'Offering' 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:
--
-- 'resourceSpecification', 'offering_resourceSpecification' - Resource configuration details
--
-- 'currencyCode', 'offering_currencyCode' - Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g.
-- \'USD\'
--
-- 'arn', 'offering_arn' - Unique offering ARN, e.g.
-- \'arn:aws:medialive:us-west-2:123456789012:offering:87654321\'
--
-- 'offeringId', 'offering_offeringId' - Unique offering ID, e.g. \'87654321\'
--
-- 'region', 'offering_region' - AWS region, e.g. \'us-west-2\'
--
-- 'offeringType', 'offering_offeringType' - Offering type, e.g. \'NO_UPFRONT\'
--
-- 'usagePrice', 'offering_usagePrice' - Recurring usage charge for each reserved resource, e.g. \'157.0\'
--
-- 'fixedPrice', 'offering_fixedPrice' - One-time charge for each reserved resource, e.g. \'0.0\' for a
-- NO_UPFRONT offering
--
-- 'durationUnits', 'offering_durationUnits' - Units for duration, e.g. \'MONTHS\'
--
-- 'offeringDescription', 'offering_offeringDescription' - Offering description, e.g. \'HD AVC output at 10-20 Mbps, 30 fps, and
-- standard VQ in US West (Oregon)\'
--
-- 'duration', 'offering_duration' - Lease duration, e.g. \'12\'
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
    }

-- | Resource configuration details
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)

-- | Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g.
-- \'USD\'
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)

-- | Unique offering ARN, e.g.
-- \'arn:aws:medialive:us-west-2:123456789012:offering:87654321\'
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)

-- | Unique offering ID, e.g. \'87654321\'
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)

-- | AWS region, e.g. \'us-west-2\'
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 type, e.g. \'NO_UPFRONT\'
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)

-- | Recurring usage charge for each reserved resource, e.g. \'157.0\'
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)

-- | One-time charge for each reserved resource, e.g. \'0.0\' for a
-- NO_UPFRONT 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)

-- | Units for duration, e.g. \'MONTHS\'
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 description, e.g. \'HD AVC output at 10-20 Mbps, 30 fps, and
-- standard VQ in US West (Oregon)\'
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)

-- | Lease duration, e.g. \'12\'
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