{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.PurchaseOffering
-- 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)
--
-- Purchase an offering and create a reservation.
module Amazonka.MediaLive.PurchaseOffering
  ( -- * Creating a Request
    PurchaseOffering' (..),
    newPurchaseOffering',

    -- * Request Lenses
    purchaseOffering'_requestId,
    purchaseOffering'_start,
    purchaseOffering'_name,
    purchaseOffering'_tags,
    purchaseOffering'_offeringId,
    purchaseOffering'_count,

    -- * Destructuring the Response
    PurchaseOfferingResponse (..),
    newPurchaseOfferingResponse,

    -- * Response Lenses
    purchaseOfferingResponse_reservation,
    purchaseOfferingResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Placeholder documentation for PurchaseOfferingRequest
--
-- /See:/ 'newPurchaseOffering'' smart constructor.
data PurchaseOffering' = PurchaseOffering''
  { -- | Unique request ID to be specified. This is needed to prevent retries
    -- from creating multiple resources.
    PurchaseOffering' -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | Requested reservation start time (UTC) in ISO-8601 format. The specified
    -- time must be between the first day of the current month and one year
    -- from now. If no value is given, the default is now.
    PurchaseOffering' -> Maybe Text
start :: Prelude.Maybe Prelude.Text,
    -- | Name for the new reservation
    PurchaseOffering' -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A collection of key-value pairs
    PurchaseOffering' -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Offering to purchase, e.g. \'87654321\'
    PurchaseOffering' -> Text
offeringId :: Prelude.Text,
    -- | Number of resources
    PurchaseOffering' -> Natural
count :: Prelude.Natural
  }
  deriving (PurchaseOffering' -> PurchaseOffering' -> Bool
(PurchaseOffering' -> PurchaseOffering' -> Bool)
-> (PurchaseOffering' -> PurchaseOffering' -> Bool)
-> Eq PurchaseOffering'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PurchaseOffering' -> PurchaseOffering' -> Bool
$c/= :: PurchaseOffering' -> PurchaseOffering' -> Bool
== :: PurchaseOffering' -> PurchaseOffering' -> Bool
$c== :: PurchaseOffering' -> PurchaseOffering' -> Bool
Prelude.Eq, ReadPrec [PurchaseOffering']
ReadPrec PurchaseOffering'
Int -> ReadS PurchaseOffering'
ReadS [PurchaseOffering']
(Int -> ReadS PurchaseOffering')
-> ReadS [PurchaseOffering']
-> ReadPrec PurchaseOffering'
-> ReadPrec [PurchaseOffering']
-> Read PurchaseOffering'
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PurchaseOffering']
$creadListPrec :: ReadPrec [PurchaseOffering']
readPrec :: ReadPrec PurchaseOffering'
$creadPrec :: ReadPrec PurchaseOffering'
readList :: ReadS [PurchaseOffering']
$creadList :: ReadS [PurchaseOffering']
readsPrec :: Int -> ReadS PurchaseOffering'
$creadsPrec :: Int -> ReadS PurchaseOffering'
Prelude.Read, Int -> PurchaseOffering' -> ShowS
[PurchaseOffering'] -> ShowS
PurchaseOffering' -> String
(Int -> PurchaseOffering' -> ShowS)
-> (PurchaseOffering' -> String)
-> ([PurchaseOffering'] -> ShowS)
-> Show PurchaseOffering'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PurchaseOffering'] -> ShowS
$cshowList :: [PurchaseOffering'] -> ShowS
show :: PurchaseOffering' -> String
$cshow :: PurchaseOffering' -> String
showsPrec :: Int -> PurchaseOffering' -> ShowS
$cshowsPrec :: Int -> PurchaseOffering' -> ShowS
Prelude.Show, (forall x. PurchaseOffering' -> Rep PurchaseOffering' x)
-> (forall x. Rep PurchaseOffering' x -> PurchaseOffering')
-> Generic PurchaseOffering'
forall x. Rep PurchaseOffering' x -> PurchaseOffering'
forall x. PurchaseOffering' -> Rep PurchaseOffering' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PurchaseOffering' x -> PurchaseOffering'
$cfrom :: forall x. PurchaseOffering' -> Rep PurchaseOffering' x
Prelude.Generic)

-- |
-- Create a value of 'PurchaseOffering'' 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:
--
-- 'requestId', 'purchaseOffering'_requestId' - Unique request ID to be specified. This is needed to prevent retries
-- from creating multiple resources.
--
-- 'start', 'purchaseOffering'_start' - Requested reservation start time (UTC) in ISO-8601 format. The specified
-- time must be between the first day of the current month and one year
-- from now. If no value is given, the default is now.
--
-- 'name', 'purchaseOffering'_name' - Name for the new reservation
--
-- 'tags', 'purchaseOffering'_tags' - A collection of key-value pairs
--
-- 'offeringId', 'purchaseOffering'_offeringId' - Offering to purchase, e.g. \'87654321\'
--
-- 'count', 'purchaseOffering'_count' - Number of resources
newPurchaseOffering' ::
  -- | 'offeringId'
  Prelude.Text ->
  -- | 'count'
  Prelude.Natural ->
  PurchaseOffering'
newPurchaseOffering' :: Text -> Natural -> PurchaseOffering'
newPurchaseOffering' Text
pOfferingId_ Natural
pCount_ =
  PurchaseOffering'' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Natural
-> PurchaseOffering'
PurchaseOffering''
    { $sel:requestId:PurchaseOffering'' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:start:PurchaseOffering'' :: Maybe Text
start = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:PurchaseOffering'' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:PurchaseOffering'' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:offeringId:PurchaseOffering'' :: Text
offeringId = Text
pOfferingId_,
      $sel:count:PurchaseOffering'' :: Natural
count = Natural
pCount_
    }

-- | Unique request ID to be specified. This is needed to prevent retries
-- from creating multiple resources.
purchaseOffering'_requestId :: Lens.Lens' PurchaseOffering' (Prelude.Maybe Prelude.Text)
purchaseOffering'_requestId :: (Maybe Text -> f (Maybe Text))
-> PurchaseOffering' -> f PurchaseOffering'
purchaseOffering'_requestId = (PurchaseOffering' -> Maybe Text)
-> (PurchaseOffering' -> Maybe Text -> PurchaseOffering')
-> Lens
     PurchaseOffering' PurchaseOffering' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PurchaseOffering'' {Maybe Text
requestId :: Maybe Text
$sel:requestId:PurchaseOffering'' :: PurchaseOffering' -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: PurchaseOffering'
s@PurchaseOffering'' {} Maybe Text
a -> PurchaseOffering'
s {$sel:requestId:PurchaseOffering'' :: Maybe Text
requestId = Maybe Text
a} :: PurchaseOffering')

-- | Requested reservation start time (UTC) in ISO-8601 format. The specified
-- time must be between the first day of the current month and one year
-- from now. If no value is given, the default is now.
purchaseOffering'_start :: Lens.Lens' PurchaseOffering' (Prelude.Maybe Prelude.Text)
purchaseOffering'_start :: (Maybe Text -> f (Maybe Text))
-> PurchaseOffering' -> f PurchaseOffering'
purchaseOffering'_start = (PurchaseOffering' -> Maybe Text)
-> (PurchaseOffering' -> Maybe Text -> PurchaseOffering')
-> Lens
     PurchaseOffering' PurchaseOffering' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PurchaseOffering'' {Maybe Text
start :: Maybe Text
$sel:start:PurchaseOffering'' :: PurchaseOffering' -> Maybe Text
start} -> Maybe Text
start) (\s :: PurchaseOffering'
s@PurchaseOffering'' {} Maybe Text
a -> PurchaseOffering'
s {$sel:start:PurchaseOffering'' :: Maybe Text
start = Maybe Text
a} :: PurchaseOffering')

-- | Name for the new reservation
purchaseOffering'_name :: Lens.Lens' PurchaseOffering' (Prelude.Maybe Prelude.Text)
purchaseOffering'_name :: (Maybe Text -> f (Maybe Text))
-> PurchaseOffering' -> f PurchaseOffering'
purchaseOffering'_name = (PurchaseOffering' -> Maybe Text)
-> (PurchaseOffering' -> Maybe Text -> PurchaseOffering')
-> Lens
     PurchaseOffering' PurchaseOffering' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PurchaseOffering'' {Maybe Text
name :: Maybe Text
$sel:name:PurchaseOffering'' :: PurchaseOffering' -> Maybe Text
name} -> Maybe Text
name) (\s :: PurchaseOffering'
s@PurchaseOffering'' {} Maybe Text
a -> PurchaseOffering'
s {$sel:name:PurchaseOffering'' :: Maybe Text
name = Maybe Text
a} :: PurchaseOffering')

-- | A collection of key-value pairs
purchaseOffering'_tags :: Lens.Lens' PurchaseOffering' (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
purchaseOffering'_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PurchaseOffering' -> f PurchaseOffering'
purchaseOffering'_tags = (PurchaseOffering' -> Maybe (HashMap Text Text))
-> (PurchaseOffering'
    -> Maybe (HashMap Text Text) -> PurchaseOffering')
-> Lens
     PurchaseOffering'
     PurchaseOffering'
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PurchaseOffering'' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:PurchaseOffering'' :: PurchaseOffering' -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: PurchaseOffering'
s@PurchaseOffering'' {} Maybe (HashMap Text Text)
a -> PurchaseOffering'
s {$sel:tags:PurchaseOffering'' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: PurchaseOffering') ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> PurchaseOffering' -> f PurchaseOffering')
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PurchaseOffering'
-> f PurchaseOffering'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Offering to purchase, e.g. \'87654321\'
purchaseOffering'_offeringId :: Lens.Lens' PurchaseOffering' Prelude.Text
purchaseOffering'_offeringId :: (Text -> f Text) -> PurchaseOffering' -> f PurchaseOffering'
purchaseOffering'_offeringId = (PurchaseOffering' -> Text)
-> (PurchaseOffering' -> Text -> PurchaseOffering')
-> Lens PurchaseOffering' PurchaseOffering' Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PurchaseOffering'' {Text
offeringId :: Text
$sel:offeringId:PurchaseOffering'' :: PurchaseOffering' -> Text
offeringId} -> Text
offeringId) (\s :: PurchaseOffering'
s@PurchaseOffering'' {} Text
a -> PurchaseOffering'
s {$sel:offeringId:PurchaseOffering'' :: Text
offeringId = Text
a} :: PurchaseOffering')

-- | Number of resources
purchaseOffering'_count :: Lens.Lens' PurchaseOffering' Prelude.Natural
purchaseOffering'_count :: (Natural -> f Natural) -> PurchaseOffering' -> f PurchaseOffering'
purchaseOffering'_count = (PurchaseOffering' -> Natural)
-> (PurchaseOffering' -> Natural -> PurchaseOffering')
-> Lens PurchaseOffering' PurchaseOffering' Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PurchaseOffering'' {Natural
count :: Natural
$sel:count:PurchaseOffering'' :: PurchaseOffering' -> Natural
count} -> Natural
count) (\s :: PurchaseOffering'
s@PurchaseOffering'' {} Natural
a -> PurchaseOffering'
s {$sel:count:PurchaseOffering'' :: Natural
count = Natural
a} :: PurchaseOffering')

instance Core.AWSRequest PurchaseOffering' where
  type
    AWSResponse PurchaseOffering' =
      PurchaseOfferingResponse
  request :: PurchaseOffering' -> Request PurchaseOffering'
request = Service -> PurchaseOffering' -> Request PurchaseOffering'
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PurchaseOffering'
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PurchaseOffering')))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse PurchaseOffering'))
-> Logger
-> Service
-> Proxy PurchaseOffering'
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PurchaseOffering')))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Reservation -> Int -> PurchaseOfferingResponse
PurchaseOfferingResponse'
            (Maybe Reservation -> Int -> PurchaseOfferingResponse)
-> Either String (Maybe Reservation)
-> Either String (Int -> PurchaseOfferingResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Reservation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"reservation")
            Either String (Int -> PurchaseOfferingResponse)
-> Either String Int -> Either String PurchaseOfferingResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable PurchaseOffering'

instance Prelude.NFData PurchaseOffering'

instance Core.ToHeaders PurchaseOffering' where
  toHeaders :: PurchaseOffering' -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PurchaseOffering' -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON PurchaseOffering' where
  toJSON :: PurchaseOffering' -> Value
toJSON PurchaseOffering'' {Natural
Maybe Text
Maybe (HashMap Text Text)
Text
count :: Natural
offeringId :: Text
tags :: Maybe (HashMap Text Text)
name :: Maybe Text
start :: Maybe Text
requestId :: Maybe Text
$sel:count:PurchaseOffering'' :: PurchaseOffering' -> Natural
$sel:offeringId:PurchaseOffering'' :: PurchaseOffering' -> Text
$sel:tags:PurchaseOffering'' :: PurchaseOffering' -> Maybe (HashMap Text Text)
$sel:name:PurchaseOffering'' :: PurchaseOffering' -> Maybe Text
$sel:start:PurchaseOffering'' :: PurchaseOffering' -> Maybe Text
$sel:requestId:PurchaseOffering'' :: PurchaseOffering' -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"requestId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
requestId,
            (Text
"start" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
start,
            (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"count" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
count)
          ]
      )

instance Core.ToPath PurchaseOffering' where
  toPath :: PurchaseOffering' -> ByteString
toPath PurchaseOffering'' {Natural
Maybe Text
Maybe (HashMap Text Text)
Text
count :: Natural
offeringId :: Text
tags :: Maybe (HashMap Text Text)
name :: Maybe Text
start :: Maybe Text
requestId :: Maybe Text
$sel:count:PurchaseOffering'' :: PurchaseOffering' -> Natural
$sel:offeringId:PurchaseOffering'' :: PurchaseOffering' -> Text
$sel:tags:PurchaseOffering'' :: PurchaseOffering' -> Maybe (HashMap Text Text)
$sel:name:PurchaseOffering'' :: PurchaseOffering' -> Maybe Text
$sel:start:PurchaseOffering'' :: PurchaseOffering' -> Maybe Text
$sel:requestId:PurchaseOffering'' :: PurchaseOffering' -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/prod/offerings/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
offeringId,
        ByteString
"/purchase"
      ]

instance Core.ToQuery PurchaseOffering' where
  toQuery :: PurchaseOffering' -> QueryString
toQuery = QueryString -> PurchaseOffering' -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | Placeholder documentation for PurchaseOfferingResponse
--
-- /See:/ 'newPurchaseOfferingResponse' smart constructor.
data PurchaseOfferingResponse = PurchaseOfferingResponse'
  { PurchaseOfferingResponse -> Maybe Reservation
reservation :: Prelude.Maybe Reservation,
    -- | The response's http status code.
    PurchaseOfferingResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PurchaseOfferingResponse -> PurchaseOfferingResponse -> Bool
(PurchaseOfferingResponse -> PurchaseOfferingResponse -> Bool)
-> (PurchaseOfferingResponse -> PurchaseOfferingResponse -> Bool)
-> Eq PurchaseOfferingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PurchaseOfferingResponse -> PurchaseOfferingResponse -> Bool
$c/= :: PurchaseOfferingResponse -> PurchaseOfferingResponse -> Bool
== :: PurchaseOfferingResponse -> PurchaseOfferingResponse -> Bool
$c== :: PurchaseOfferingResponse -> PurchaseOfferingResponse -> Bool
Prelude.Eq, ReadPrec [PurchaseOfferingResponse]
ReadPrec PurchaseOfferingResponse
Int -> ReadS PurchaseOfferingResponse
ReadS [PurchaseOfferingResponse]
(Int -> ReadS PurchaseOfferingResponse)
-> ReadS [PurchaseOfferingResponse]
-> ReadPrec PurchaseOfferingResponse
-> ReadPrec [PurchaseOfferingResponse]
-> Read PurchaseOfferingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PurchaseOfferingResponse]
$creadListPrec :: ReadPrec [PurchaseOfferingResponse]
readPrec :: ReadPrec PurchaseOfferingResponse
$creadPrec :: ReadPrec PurchaseOfferingResponse
readList :: ReadS [PurchaseOfferingResponse]
$creadList :: ReadS [PurchaseOfferingResponse]
readsPrec :: Int -> ReadS PurchaseOfferingResponse
$creadsPrec :: Int -> ReadS PurchaseOfferingResponse
Prelude.Read, Int -> PurchaseOfferingResponse -> ShowS
[PurchaseOfferingResponse] -> ShowS
PurchaseOfferingResponse -> String
(Int -> PurchaseOfferingResponse -> ShowS)
-> (PurchaseOfferingResponse -> String)
-> ([PurchaseOfferingResponse] -> ShowS)
-> Show PurchaseOfferingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PurchaseOfferingResponse] -> ShowS
$cshowList :: [PurchaseOfferingResponse] -> ShowS
show :: PurchaseOfferingResponse -> String
$cshow :: PurchaseOfferingResponse -> String
showsPrec :: Int -> PurchaseOfferingResponse -> ShowS
$cshowsPrec :: Int -> PurchaseOfferingResponse -> ShowS
Prelude.Show, (forall x.
 PurchaseOfferingResponse -> Rep PurchaseOfferingResponse x)
-> (forall x.
    Rep PurchaseOfferingResponse x -> PurchaseOfferingResponse)
-> Generic PurchaseOfferingResponse
forall x.
Rep PurchaseOfferingResponse x -> PurchaseOfferingResponse
forall x.
PurchaseOfferingResponse -> Rep PurchaseOfferingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PurchaseOfferingResponse x -> PurchaseOfferingResponse
$cfrom :: forall x.
PurchaseOfferingResponse -> Rep PurchaseOfferingResponse x
Prelude.Generic)

-- |
-- Create a value of 'PurchaseOfferingResponse' 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:
--
-- 'reservation', 'purchaseOfferingResponse_reservation' - Undocumented member.
--
-- 'httpStatus', 'purchaseOfferingResponse_httpStatus' - The response's http status code.
newPurchaseOfferingResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PurchaseOfferingResponse
newPurchaseOfferingResponse :: Int -> PurchaseOfferingResponse
newPurchaseOfferingResponse Int
pHttpStatus_ =
  PurchaseOfferingResponse' :: Maybe Reservation -> Int -> PurchaseOfferingResponse
PurchaseOfferingResponse'
    { $sel:reservation:PurchaseOfferingResponse' :: Maybe Reservation
reservation =
        Maybe Reservation
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:PurchaseOfferingResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
purchaseOfferingResponse_reservation :: Lens.Lens' PurchaseOfferingResponse (Prelude.Maybe Reservation)
purchaseOfferingResponse_reservation :: (Maybe Reservation -> f (Maybe Reservation))
-> PurchaseOfferingResponse -> f PurchaseOfferingResponse
purchaseOfferingResponse_reservation = (PurchaseOfferingResponse -> Maybe Reservation)
-> (PurchaseOfferingResponse
    -> Maybe Reservation -> PurchaseOfferingResponse)
-> Lens
     PurchaseOfferingResponse
     PurchaseOfferingResponse
     (Maybe Reservation)
     (Maybe Reservation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PurchaseOfferingResponse' {Maybe Reservation
reservation :: Maybe Reservation
$sel:reservation:PurchaseOfferingResponse' :: PurchaseOfferingResponse -> Maybe Reservation
reservation} -> Maybe Reservation
reservation) (\s :: PurchaseOfferingResponse
s@PurchaseOfferingResponse' {} Maybe Reservation
a -> PurchaseOfferingResponse
s {$sel:reservation:PurchaseOfferingResponse' :: Maybe Reservation
reservation = Maybe Reservation
a} :: PurchaseOfferingResponse)

-- | The response's http status code.
purchaseOfferingResponse_httpStatus :: Lens.Lens' PurchaseOfferingResponse Prelude.Int
purchaseOfferingResponse_httpStatus :: (Int -> f Int)
-> PurchaseOfferingResponse -> f PurchaseOfferingResponse
purchaseOfferingResponse_httpStatus = (PurchaseOfferingResponse -> Int)
-> (PurchaseOfferingResponse -> Int -> PurchaseOfferingResponse)
-> Lens PurchaseOfferingResponse PurchaseOfferingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PurchaseOfferingResponse' {Int
httpStatus :: Int
$sel:httpStatus:PurchaseOfferingResponse' :: PurchaseOfferingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PurchaseOfferingResponse
s@PurchaseOfferingResponse' {} Int
a -> PurchaseOfferingResponse
s {$sel:httpStatus:PurchaseOfferingResponse' :: Int
httpStatus = Int
a} :: PurchaseOfferingResponse)

instance Prelude.NFData PurchaseOfferingResponse