{-# 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.ElasticSearch.PurchaseReservedElasticsearchInstanceOffering
-- 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)
--
-- Allows you to purchase reserved Elasticsearch instances.
module Amazonka.ElasticSearch.PurchaseReservedElasticsearchInstanceOffering
  ( -- * Creating a Request
    PurchaseReservedElasticsearchInstanceOffering (..),
    newPurchaseReservedElasticsearchInstanceOffering,

    -- * Request Lenses
    purchaseReservedElasticsearchInstanceOffering_instanceCount,
    purchaseReservedElasticsearchInstanceOffering_reservedElasticsearchInstanceOfferingId,
    purchaseReservedElasticsearchInstanceOffering_reservationName,

    -- * Destructuring the Response
    PurchaseReservedElasticsearchInstanceOfferingResponse (..),
    newPurchaseReservedElasticsearchInstanceOfferingResponse,

    -- * Response Lenses
    purchaseReservedElasticsearchInstanceOfferingResponse_reservedElasticsearchInstanceId,
    purchaseReservedElasticsearchInstanceOfferingResponse_reservationName,
    purchaseReservedElasticsearchInstanceOfferingResponse_httpStatus,
  )
where

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

-- | Container for parameters to
-- @PurchaseReservedElasticsearchInstanceOffering@
--
-- /See:/ 'newPurchaseReservedElasticsearchInstanceOffering' smart constructor.
data PurchaseReservedElasticsearchInstanceOffering = PurchaseReservedElasticsearchInstanceOffering'
  { -- | The number of Elasticsearch instances to reserve.
    PurchaseReservedElasticsearchInstanceOffering -> Maybe Natural
instanceCount :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the reserved Elasticsearch instance offering to purchase.
    PurchaseReservedElasticsearchInstanceOffering -> Text
reservedElasticsearchInstanceOfferingId :: Prelude.Text,
    -- | A customer-specified identifier to track this reservation.
    PurchaseReservedElasticsearchInstanceOffering -> Text
reservationName :: Prelude.Text
  }
  deriving (PurchaseReservedElasticsearchInstanceOffering
-> PurchaseReservedElasticsearchInstanceOffering -> Bool
(PurchaseReservedElasticsearchInstanceOffering
 -> PurchaseReservedElasticsearchInstanceOffering -> Bool)
-> (PurchaseReservedElasticsearchInstanceOffering
    -> PurchaseReservedElasticsearchInstanceOffering -> Bool)
-> Eq PurchaseReservedElasticsearchInstanceOffering
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PurchaseReservedElasticsearchInstanceOffering
-> PurchaseReservedElasticsearchInstanceOffering -> Bool
$c/= :: PurchaseReservedElasticsearchInstanceOffering
-> PurchaseReservedElasticsearchInstanceOffering -> Bool
== :: PurchaseReservedElasticsearchInstanceOffering
-> PurchaseReservedElasticsearchInstanceOffering -> Bool
$c== :: PurchaseReservedElasticsearchInstanceOffering
-> PurchaseReservedElasticsearchInstanceOffering -> Bool
Prelude.Eq, ReadPrec [PurchaseReservedElasticsearchInstanceOffering]
ReadPrec PurchaseReservedElasticsearchInstanceOffering
Int -> ReadS PurchaseReservedElasticsearchInstanceOffering
ReadS [PurchaseReservedElasticsearchInstanceOffering]
(Int -> ReadS PurchaseReservedElasticsearchInstanceOffering)
-> ReadS [PurchaseReservedElasticsearchInstanceOffering]
-> ReadPrec PurchaseReservedElasticsearchInstanceOffering
-> ReadPrec [PurchaseReservedElasticsearchInstanceOffering]
-> Read PurchaseReservedElasticsearchInstanceOffering
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PurchaseReservedElasticsearchInstanceOffering]
$creadListPrec :: ReadPrec [PurchaseReservedElasticsearchInstanceOffering]
readPrec :: ReadPrec PurchaseReservedElasticsearchInstanceOffering
$creadPrec :: ReadPrec PurchaseReservedElasticsearchInstanceOffering
readList :: ReadS [PurchaseReservedElasticsearchInstanceOffering]
$creadList :: ReadS [PurchaseReservedElasticsearchInstanceOffering]
readsPrec :: Int -> ReadS PurchaseReservedElasticsearchInstanceOffering
$creadsPrec :: Int -> ReadS PurchaseReservedElasticsearchInstanceOffering
Prelude.Read, Int -> PurchaseReservedElasticsearchInstanceOffering -> ShowS
[PurchaseReservedElasticsearchInstanceOffering] -> ShowS
PurchaseReservedElasticsearchInstanceOffering -> String
(Int -> PurchaseReservedElasticsearchInstanceOffering -> ShowS)
-> (PurchaseReservedElasticsearchInstanceOffering -> String)
-> ([PurchaseReservedElasticsearchInstanceOffering] -> ShowS)
-> Show PurchaseReservedElasticsearchInstanceOffering
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PurchaseReservedElasticsearchInstanceOffering] -> ShowS
$cshowList :: [PurchaseReservedElasticsearchInstanceOffering] -> ShowS
show :: PurchaseReservedElasticsearchInstanceOffering -> String
$cshow :: PurchaseReservedElasticsearchInstanceOffering -> String
showsPrec :: Int -> PurchaseReservedElasticsearchInstanceOffering -> ShowS
$cshowsPrec :: Int -> PurchaseReservedElasticsearchInstanceOffering -> ShowS
Prelude.Show, (forall x.
 PurchaseReservedElasticsearchInstanceOffering
 -> Rep PurchaseReservedElasticsearchInstanceOffering x)
-> (forall x.
    Rep PurchaseReservedElasticsearchInstanceOffering x
    -> PurchaseReservedElasticsearchInstanceOffering)
-> Generic PurchaseReservedElasticsearchInstanceOffering
forall x.
Rep PurchaseReservedElasticsearchInstanceOffering x
-> PurchaseReservedElasticsearchInstanceOffering
forall x.
PurchaseReservedElasticsearchInstanceOffering
-> Rep PurchaseReservedElasticsearchInstanceOffering x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PurchaseReservedElasticsearchInstanceOffering x
-> PurchaseReservedElasticsearchInstanceOffering
$cfrom :: forall x.
PurchaseReservedElasticsearchInstanceOffering
-> Rep PurchaseReservedElasticsearchInstanceOffering x
Prelude.Generic)

-- |
-- Create a value of 'PurchaseReservedElasticsearchInstanceOffering' 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:
--
-- 'instanceCount', 'purchaseReservedElasticsearchInstanceOffering_instanceCount' - The number of Elasticsearch instances to reserve.
--
-- 'reservedElasticsearchInstanceOfferingId', 'purchaseReservedElasticsearchInstanceOffering_reservedElasticsearchInstanceOfferingId' - The ID of the reserved Elasticsearch instance offering to purchase.
--
-- 'reservationName', 'purchaseReservedElasticsearchInstanceOffering_reservationName' - A customer-specified identifier to track this reservation.
newPurchaseReservedElasticsearchInstanceOffering ::
  -- | 'reservedElasticsearchInstanceOfferingId'
  Prelude.Text ->
  -- | 'reservationName'
  Prelude.Text ->
  PurchaseReservedElasticsearchInstanceOffering
newPurchaseReservedElasticsearchInstanceOffering :: Text -> Text -> PurchaseReservedElasticsearchInstanceOffering
newPurchaseReservedElasticsearchInstanceOffering
  Text
pReservedElasticsearchInstanceOfferingId_
  Text
pReservationName_ =
    PurchaseReservedElasticsearchInstanceOffering' :: Maybe Natural
-> Text -> Text -> PurchaseReservedElasticsearchInstanceOffering
PurchaseReservedElasticsearchInstanceOffering'
      { $sel:instanceCount:PurchaseReservedElasticsearchInstanceOffering' :: Maybe Natural
instanceCount =
          Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:reservedElasticsearchInstanceOfferingId:PurchaseReservedElasticsearchInstanceOffering' :: Text
reservedElasticsearchInstanceOfferingId =
          Text
pReservedElasticsearchInstanceOfferingId_,
        $sel:reservationName:PurchaseReservedElasticsearchInstanceOffering' :: Text
reservationName =
          Text
pReservationName_
      }

-- | The number of Elasticsearch instances to reserve.
purchaseReservedElasticsearchInstanceOffering_instanceCount :: Lens.Lens' PurchaseReservedElasticsearchInstanceOffering (Prelude.Maybe Prelude.Natural)
purchaseReservedElasticsearchInstanceOffering_instanceCount :: (Maybe Natural -> f (Maybe Natural))
-> PurchaseReservedElasticsearchInstanceOffering
-> f PurchaseReservedElasticsearchInstanceOffering
purchaseReservedElasticsearchInstanceOffering_instanceCount = (PurchaseReservedElasticsearchInstanceOffering -> Maybe Natural)
-> (PurchaseReservedElasticsearchInstanceOffering
    -> Maybe Natural -> PurchaseReservedElasticsearchInstanceOffering)
-> Lens
     PurchaseReservedElasticsearchInstanceOffering
     PurchaseReservedElasticsearchInstanceOffering
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PurchaseReservedElasticsearchInstanceOffering' {Maybe Natural
instanceCount :: Maybe Natural
$sel:instanceCount:PurchaseReservedElasticsearchInstanceOffering' :: PurchaseReservedElasticsearchInstanceOffering -> Maybe Natural
instanceCount} -> Maybe Natural
instanceCount) (\s :: PurchaseReservedElasticsearchInstanceOffering
s@PurchaseReservedElasticsearchInstanceOffering' {} Maybe Natural
a -> PurchaseReservedElasticsearchInstanceOffering
s {$sel:instanceCount:PurchaseReservedElasticsearchInstanceOffering' :: Maybe Natural
instanceCount = Maybe Natural
a} :: PurchaseReservedElasticsearchInstanceOffering)

-- | The ID of the reserved Elasticsearch instance offering to purchase.
purchaseReservedElasticsearchInstanceOffering_reservedElasticsearchInstanceOfferingId :: Lens.Lens' PurchaseReservedElasticsearchInstanceOffering Prelude.Text
purchaseReservedElasticsearchInstanceOffering_reservedElasticsearchInstanceOfferingId :: (Text -> f Text)
-> PurchaseReservedElasticsearchInstanceOffering
-> f PurchaseReservedElasticsearchInstanceOffering
purchaseReservedElasticsearchInstanceOffering_reservedElasticsearchInstanceOfferingId = (PurchaseReservedElasticsearchInstanceOffering -> Text)
-> (PurchaseReservedElasticsearchInstanceOffering
    -> Text -> PurchaseReservedElasticsearchInstanceOffering)
-> Lens
     PurchaseReservedElasticsearchInstanceOffering
     PurchaseReservedElasticsearchInstanceOffering
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PurchaseReservedElasticsearchInstanceOffering' {Text
reservedElasticsearchInstanceOfferingId :: Text
$sel:reservedElasticsearchInstanceOfferingId:PurchaseReservedElasticsearchInstanceOffering' :: PurchaseReservedElasticsearchInstanceOffering -> Text
reservedElasticsearchInstanceOfferingId} -> Text
reservedElasticsearchInstanceOfferingId) (\s :: PurchaseReservedElasticsearchInstanceOffering
s@PurchaseReservedElasticsearchInstanceOffering' {} Text
a -> PurchaseReservedElasticsearchInstanceOffering
s {$sel:reservedElasticsearchInstanceOfferingId:PurchaseReservedElasticsearchInstanceOffering' :: Text
reservedElasticsearchInstanceOfferingId = Text
a} :: PurchaseReservedElasticsearchInstanceOffering)

-- | A customer-specified identifier to track this reservation.
purchaseReservedElasticsearchInstanceOffering_reservationName :: Lens.Lens' PurchaseReservedElasticsearchInstanceOffering Prelude.Text
purchaseReservedElasticsearchInstanceOffering_reservationName :: (Text -> f Text)
-> PurchaseReservedElasticsearchInstanceOffering
-> f PurchaseReservedElasticsearchInstanceOffering
purchaseReservedElasticsearchInstanceOffering_reservationName = (PurchaseReservedElasticsearchInstanceOffering -> Text)
-> (PurchaseReservedElasticsearchInstanceOffering
    -> Text -> PurchaseReservedElasticsearchInstanceOffering)
-> Lens
     PurchaseReservedElasticsearchInstanceOffering
     PurchaseReservedElasticsearchInstanceOffering
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PurchaseReservedElasticsearchInstanceOffering' {Text
reservationName :: Text
$sel:reservationName:PurchaseReservedElasticsearchInstanceOffering' :: PurchaseReservedElasticsearchInstanceOffering -> Text
reservationName} -> Text
reservationName) (\s :: PurchaseReservedElasticsearchInstanceOffering
s@PurchaseReservedElasticsearchInstanceOffering' {} Text
a -> PurchaseReservedElasticsearchInstanceOffering
s {$sel:reservationName:PurchaseReservedElasticsearchInstanceOffering' :: Text
reservationName = Text
a} :: PurchaseReservedElasticsearchInstanceOffering)

instance
  Core.AWSRequest
    PurchaseReservedElasticsearchInstanceOffering
  where
  type
    AWSResponse
      PurchaseReservedElasticsearchInstanceOffering =
      PurchaseReservedElasticsearchInstanceOfferingResponse
  request :: PurchaseReservedElasticsearchInstanceOffering
-> Request PurchaseReservedElasticsearchInstanceOffering
request = Service
-> PurchaseReservedElasticsearchInstanceOffering
-> Request PurchaseReservedElasticsearchInstanceOffering
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PurchaseReservedElasticsearchInstanceOffering
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse PurchaseReservedElasticsearchInstanceOffering)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse PurchaseReservedElasticsearchInstanceOffering))
-> Logger
-> Service
-> Proxy PurchaseReservedElasticsearchInstanceOffering
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse PurchaseReservedElasticsearchInstanceOffering)))
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 Text
-> Maybe Text
-> Int
-> PurchaseReservedElasticsearchInstanceOfferingResponse
PurchaseReservedElasticsearchInstanceOfferingResponse'
            (Maybe Text
 -> Maybe Text
 -> Int
 -> PurchaseReservedElasticsearchInstanceOfferingResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Int -> PurchaseReservedElasticsearchInstanceOfferingResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ReservedElasticsearchInstanceId")
              Either
  String
  (Maybe Text
   -> Int -> PurchaseReservedElasticsearchInstanceOfferingResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int -> PurchaseReservedElasticsearchInstanceOfferingResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ReservationName")
              Either
  String
  (Int -> PurchaseReservedElasticsearchInstanceOfferingResponse)
-> Either String Int
-> Either
     String PurchaseReservedElasticsearchInstanceOfferingResponse
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
    PurchaseReservedElasticsearchInstanceOffering

instance
  Prelude.NFData
    PurchaseReservedElasticsearchInstanceOffering

instance
  Core.ToHeaders
    PurchaseReservedElasticsearchInstanceOffering
  where
  toHeaders :: PurchaseReservedElasticsearchInstanceOffering -> ResponseHeaders
toHeaders = ResponseHeaders
-> PurchaseReservedElasticsearchInstanceOffering -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance
  Core.ToJSON
    PurchaseReservedElasticsearchInstanceOffering
  where
  toJSON :: PurchaseReservedElasticsearchInstanceOffering -> Value
toJSON
    PurchaseReservedElasticsearchInstanceOffering' {Maybe Natural
Text
reservationName :: Text
reservedElasticsearchInstanceOfferingId :: Text
instanceCount :: Maybe Natural
$sel:reservationName:PurchaseReservedElasticsearchInstanceOffering' :: PurchaseReservedElasticsearchInstanceOffering -> Text
$sel:reservedElasticsearchInstanceOfferingId:PurchaseReservedElasticsearchInstanceOffering' :: PurchaseReservedElasticsearchInstanceOffering -> Text
$sel:instanceCount:PurchaseReservedElasticsearchInstanceOffering' :: PurchaseReservedElasticsearchInstanceOffering -> Maybe Natural
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"InstanceCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
instanceCount,
              Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
                ( Text
"ReservedElasticsearchInstanceOfferingId"
                    Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
reservedElasticsearchInstanceOfferingId
                ),
              Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
                (Text
"ReservationName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
reservationName)
            ]
        )

instance
  Core.ToPath
    PurchaseReservedElasticsearchInstanceOffering
  where
  toPath :: PurchaseReservedElasticsearchInstanceOffering -> ByteString
toPath =
    ByteString
-> PurchaseReservedElasticsearchInstanceOffering -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/2015-01-01/es/purchaseReservedInstanceOffering"

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

-- | Represents the output of a
-- @PurchaseReservedElasticsearchInstanceOffering@ operation.
--
-- /See:/ 'newPurchaseReservedElasticsearchInstanceOfferingResponse' smart constructor.
data PurchaseReservedElasticsearchInstanceOfferingResponse = PurchaseReservedElasticsearchInstanceOfferingResponse'
  { -- | Details of the reserved Elasticsearch instance which was purchased.
    PurchaseReservedElasticsearchInstanceOfferingResponse -> Maybe Text
reservedElasticsearchInstanceId :: Prelude.Maybe Prelude.Text,
    -- | The customer-specified identifier used to track this reservation.
    PurchaseReservedElasticsearchInstanceOfferingResponse -> Maybe Text
reservationName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    PurchaseReservedElasticsearchInstanceOfferingResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PurchaseReservedElasticsearchInstanceOfferingResponse
-> PurchaseReservedElasticsearchInstanceOfferingResponse -> Bool
(PurchaseReservedElasticsearchInstanceOfferingResponse
 -> PurchaseReservedElasticsearchInstanceOfferingResponse -> Bool)
-> (PurchaseReservedElasticsearchInstanceOfferingResponse
    -> PurchaseReservedElasticsearchInstanceOfferingResponse -> Bool)
-> Eq PurchaseReservedElasticsearchInstanceOfferingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PurchaseReservedElasticsearchInstanceOfferingResponse
-> PurchaseReservedElasticsearchInstanceOfferingResponse -> Bool
$c/= :: PurchaseReservedElasticsearchInstanceOfferingResponse
-> PurchaseReservedElasticsearchInstanceOfferingResponse -> Bool
== :: PurchaseReservedElasticsearchInstanceOfferingResponse
-> PurchaseReservedElasticsearchInstanceOfferingResponse -> Bool
$c== :: PurchaseReservedElasticsearchInstanceOfferingResponse
-> PurchaseReservedElasticsearchInstanceOfferingResponse -> Bool
Prelude.Eq, ReadPrec [PurchaseReservedElasticsearchInstanceOfferingResponse]
ReadPrec PurchaseReservedElasticsearchInstanceOfferingResponse
Int -> ReadS PurchaseReservedElasticsearchInstanceOfferingResponse
ReadS [PurchaseReservedElasticsearchInstanceOfferingResponse]
(Int
 -> ReadS PurchaseReservedElasticsearchInstanceOfferingResponse)
-> ReadS [PurchaseReservedElasticsearchInstanceOfferingResponse]
-> ReadPrec PurchaseReservedElasticsearchInstanceOfferingResponse
-> ReadPrec [PurchaseReservedElasticsearchInstanceOfferingResponse]
-> Read PurchaseReservedElasticsearchInstanceOfferingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PurchaseReservedElasticsearchInstanceOfferingResponse]
$creadListPrec :: ReadPrec [PurchaseReservedElasticsearchInstanceOfferingResponse]
readPrec :: ReadPrec PurchaseReservedElasticsearchInstanceOfferingResponse
$creadPrec :: ReadPrec PurchaseReservedElasticsearchInstanceOfferingResponse
readList :: ReadS [PurchaseReservedElasticsearchInstanceOfferingResponse]
$creadList :: ReadS [PurchaseReservedElasticsearchInstanceOfferingResponse]
readsPrec :: Int -> ReadS PurchaseReservedElasticsearchInstanceOfferingResponse
$creadsPrec :: Int -> ReadS PurchaseReservedElasticsearchInstanceOfferingResponse
Prelude.Read, Int
-> PurchaseReservedElasticsearchInstanceOfferingResponse -> ShowS
[PurchaseReservedElasticsearchInstanceOfferingResponse] -> ShowS
PurchaseReservedElasticsearchInstanceOfferingResponse -> String
(Int
 -> PurchaseReservedElasticsearchInstanceOfferingResponse -> ShowS)
-> (PurchaseReservedElasticsearchInstanceOfferingResponse
    -> String)
-> ([PurchaseReservedElasticsearchInstanceOfferingResponse]
    -> ShowS)
-> Show PurchaseReservedElasticsearchInstanceOfferingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PurchaseReservedElasticsearchInstanceOfferingResponse] -> ShowS
$cshowList :: [PurchaseReservedElasticsearchInstanceOfferingResponse] -> ShowS
show :: PurchaseReservedElasticsearchInstanceOfferingResponse -> String
$cshow :: PurchaseReservedElasticsearchInstanceOfferingResponse -> String
showsPrec :: Int
-> PurchaseReservedElasticsearchInstanceOfferingResponse -> ShowS
$cshowsPrec :: Int
-> PurchaseReservedElasticsearchInstanceOfferingResponse -> ShowS
Prelude.Show, (forall x.
 PurchaseReservedElasticsearchInstanceOfferingResponse
 -> Rep PurchaseReservedElasticsearchInstanceOfferingResponse x)
-> (forall x.
    Rep PurchaseReservedElasticsearchInstanceOfferingResponse x
    -> PurchaseReservedElasticsearchInstanceOfferingResponse)
-> Generic PurchaseReservedElasticsearchInstanceOfferingResponse
forall x.
Rep PurchaseReservedElasticsearchInstanceOfferingResponse x
-> PurchaseReservedElasticsearchInstanceOfferingResponse
forall x.
PurchaseReservedElasticsearchInstanceOfferingResponse
-> Rep PurchaseReservedElasticsearchInstanceOfferingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PurchaseReservedElasticsearchInstanceOfferingResponse x
-> PurchaseReservedElasticsearchInstanceOfferingResponse
$cfrom :: forall x.
PurchaseReservedElasticsearchInstanceOfferingResponse
-> Rep PurchaseReservedElasticsearchInstanceOfferingResponse x
Prelude.Generic)

-- |
-- Create a value of 'PurchaseReservedElasticsearchInstanceOfferingResponse' 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:
--
-- 'reservedElasticsearchInstanceId', 'purchaseReservedElasticsearchInstanceOfferingResponse_reservedElasticsearchInstanceId' - Details of the reserved Elasticsearch instance which was purchased.
--
-- 'reservationName', 'purchaseReservedElasticsearchInstanceOfferingResponse_reservationName' - The customer-specified identifier used to track this reservation.
--
-- 'httpStatus', 'purchaseReservedElasticsearchInstanceOfferingResponse_httpStatus' - The response's http status code.
newPurchaseReservedElasticsearchInstanceOfferingResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PurchaseReservedElasticsearchInstanceOfferingResponse
newPurchaseReservedElasticsearchInstanceOfferingResponse :: Int -> PurchaseReservedElasticsearchInstanceOfferingResponse
newPurchaseReservedElasticsearchInstanceOfferingResponse
  Int
pHttpStatus_ =
    PurchaseReservedElasticsearchInstanceOfferingResponse' :: Maybe Text
-> Maybe Text
-> Int
-> PurchaseReservedElasticsearchInstanceOfferingResponse
PurchaseReservedElasticsearchInstanceOfferingResponse'
      { $sel:reservedElasticsearchInstanceId:PurchaseReservedElasticsearchInstanceOfferingResponse' :: Maybe Text
reservedElasticsearchInstanceId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:reservationName:PurchaseReservedElasticsearchInstanceOfferingResponse' :: Maybe Text
reservationName =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:PurchaseReservedElasticsearchInstanceOfferingResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | Details of the reserved Elasticsearch instance which was purchased.
purchaseReservedElasticsearchInstanceOfferingResponse_reservedElasticsearchInstanceId :: Lens.Lens' PurchaseReservedElasticsearchInstanceOfferingResponse (Prelude.Maybe Prelude.Text)
purchaseReservedElasticsearchInstanceOfferingResponse_reservedElasticsearchInstanceId :: (Maybe Text -> f (Maybe Text))
-> PurchaseReservedElasticsearchInstanceOfferingResponse
-> f PurchaseReservedElasticsearchInstanceOfferingResponse
purchaseReservedElasticsearchInstanceOfferingResponse_reservedElasticsearchInstanceId = (PurchaseReservedElasticsearchInstanceOfferingResponse
 -> Maybe Text)
-> (PurchaseReservedElasticsearchInstanceOfferingResponse
    -> Maybe Text
    -> PurchaseReservedElasticsearchInstanceOfferingResponse)
-> Lens
     PurchaseReservedElasticsearchInstanceOfferingResponse
     PurchaseReservedElasticsearchInstanceOfferingResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PurchaseReservedElasticsearchInstanceOfferingResponse' {Maybe Text
reservedElasticsearchInstanceId :: Maybe Text
$sel:reservedElasticsearchInstanceId:PurchaseReservedElasticsearchInstanceOfferingResponse' :: PurchaseReservedElasticsearchInstanceOfferingResponse -> Maybe Text
reservedElasticsearchInstanceId} -> Maybe Text
reservedElasticsearchInstanceId) (\s :: PurchaseReservedElasticsearchInstanceOfferingResponse
s@PurchaseReservedElasticsearchInstanceOfferingResponse' {} Maybe Text
a -> PurchaseReservedElasticsearchInstanceOfferingResponse
s {$sel:reservedElasticsearchInstanceId:PurchaseReservedElasticsearchInstanceOfferingResponse' :: Maybe Text
reservedElasticsearchInstanceId = Maybe Text
a} :: PurchaseReservedElasticsearchInstanceOfferingResponse)

-- | The customer-specified identifier used to track this reservation.
purchaseReservedElasticsearchInstanceOfferingResponse_reservationName :: Lens.Lens' PurchaseReservedElasticsearchInstanceOfferingResponse (Prelude.Maybe Prelude.Text)
purchaseReservedElasticsearchInstanceOfferingResponse_reservationName :: (Maybe Text -> f (Maybe Text))
-> PurchaseReservedElasticsearchInstanceOfferingResponse
-> f PurchaseReservedElasticsearchInstanceOfferingResponse
purchaseReservedElasticsearchInstanceOfferingResponse_reservationName = (PurchaseReservedElasticsearchInstanceOfferingResponse
 -> Maybe Text)
-> (PurchaseReservedElasticsearchInstanceOfferingResponse
    -> Maybe Text
    -> PurchaseReservedElasticsearchInstanceOfferingResponse)
-> Lens
     PurchaseReservedElasticsearchInstanceOfferingResponse
     PurchaseReservedElasticsearchInstanceOfferingResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PurchaseReservedElasticsearchInstanceOfferingResponse' {Maybe Text
reservationName :: Maybe Text
$sel:reservationName:PurchaseReservedElasticsearchInstanceOfferingResponse' :: PurchaseReservedElasticsearchInstanceOfferingResponse -> Maybe Text
reservationName} -> Maybe Text
reservationName) (\s :: PurchaseReservedElasticsearchInstanceOfferingResponse
s@PurchaseReservedElasticsearchInstanceOfferingResponse' {} Maybe Text
a -> PurchaseReservedElasticsearchInstanceOfferingResponse
s {$sel:reservationName:PurchaseReservedElasticsearchInstanceOfferingResponse' :: Maybe Text
reservationName = Maybe Text
a} :: PurchaseReservedElasticsearchInstanceOfferingResponse)

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

instance
  Prelude.NFData
    PurchaseReservedElasticsearchInstanceOfferingResponse