{-# 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.EC2.CreateSubnetCidrReservation
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a subnet CIDR reservation. For information about subnet CIDR
-- reservations, see
-- <https://docs.aws.amazon.com/vpc/latest/userguide/subnet-cidr-reservation.html Subnet CIDR reservations>
-- in the /Amazon Virtual Private Cloud User Guide/.
module Amazonka.EC2.CreateSubnetCidrReservation
  ( -- * Creating a Request
    CreateSubnetCidrReservation (..),
    newCreateSubnetCidrReservation,

    -- * Request Lenses
    createSubnetCidrReservation_description,
    createSubnetCidrReservation_dryRun,
    createSubnetCidrReservation_tagSpecifications,
    createSubnetCidrReservation_subnetId,
    createSubnetCidrReservation_cidr,
    createSubnetCidrReservation_reservationType,

    -- * Destructuring the Response
    CreateSubnetCidrReservationResponse (..),
    newCreateSubnetCidrReservationResponse,

    -- * Response Lenses
    createSubnetCidrReservationResponse_subnetCidrReservation,
    createSubnetCidrReservationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateSubnetCidrReservation' smart constructor.
data CreateSubnetCidrReservation = CreateSubnetCidrReservation'
  { -- | The description to assign to the subnet CIDR reservation.
    CreateSubnetCidrReservation -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    CreateSubnetCidrReservation -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The tags to assign to the subnet CIDR reservation.
    CreateSubnetCidrReservation -> Maybe [TagSpecification]
tagSpecifications :: Prelude.Maybe [TagSpecification],
    -- | The ID of the subnet.
    CreateSubnetCidrReservation -> Text
subnetId :: Prelude.Text,
    -- | The IPv4 or IPV6 CIDR range to reserve.
    CreateSubnetCidrReservation -> Text
cidr :: Prelude.Text,
    -- | The type of reservation.
    --
    -- The following are valid values:
    --
    -- -   @prefix@: The Amazon EC2 Prefix Delegation feature assigns the IP
    --     addresses to network interfaces that are associated with an
    --     instance. For information about Prefix Delegation, see
    --     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-delegation.html Prefix Delegation for Amazon EC2 network interfaces>
    --     in the /Amazon Elastic Compute Cloud User Guide/.
    --
    -- -   @explicit@: You manually assign the IP addresses to resources that
    --     reside in your subnet.
    CreateSubnetCidrReservation -> SubnetCidrReservationType
reservationType :: SubnetCidrReservationType
  }
  deriving (CreateSubnetCidrReservation -> CreateSubnetCidrReservation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSubnetCidrReservation -> CreateSubnetCidrReservation -> Bool
$c/= :: CreateSubnetCidrReservation -> CreateSubnetCidrReservation -> Bool
== :: CreateSubnetCidrReservation -> CreateSubnetCidrReservation -> Bool
$c== :: CreateSubnetCidrReservation -> CreateSubnetCidrReservation -> Bool
Prelude.Eq, ReadPrec [CreateSubnetCidrReservation]
ReadPrec CreateSubnetCidrReservation
Int -> ReadS CreateSubnetCidrReservation
ReadS [CreateSubnetCidrReservation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSubnetCidrReservation]
$creadListPrec :: ReadPrec [CreateSubnetCidrReservation]
readPrec :: ReadPrec CreateSubnetCidrReservation
$creadPrec :: ReadPrec CreateSubnetCidrReservation
readList :: ReadS [CreateSubnetCidrReservation]
$creadList :: ReadS [CreateSubnetCidrReservation]
readsPrec :: Int -> ReadS CreateSubnetCidrReservation
$creadsPrec :: Int -> ReadS CreateSubnetCidrReservation
Prelude.Read, Int -> CreateSubnetCidrReservation -> ShowS
[CreateSubnetCidrReservation] -> ShowS
CreateSubnetCidrReservation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSubnetCidrReservation] -> ShowS
$cshowList :: [CreateSubnetCidrReservation] -> ShowS
show :: CreateSubnetCidrReservation -> String
$cshow :: CreateSubnetCidrReservation -> String
showsPrec :: Int -> CreateSubnetCidrReservation -> ShowS
$cshowsPrec :: Int -> CreateSubnetCidrReservation -> ShowS
Prelude.Show, forall x.
Rep CreateSubnetCidrReservation x -> CreateSubnetCidrReservation
forall x.
CreateSubnetCidrReservation -> Rep CreateSubnetCidrReservation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateSubnetCidrReservation x -> CreateSubnetCidrReservation
$cfrom :: forall x.
CreateSubnetCidrReservation -> Rep CreateSubnetCidrReservation x
Prelude.Generic)

-- |
-- Create a value of 'CreateSubnetCidrReservation' 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:
--
-- 'description', 'createSubnetCidrReservation_description' - The description to assign to the subnet CIDR reservation.
--
-- 'dryRun', 'createSubnetCidrReservation_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'tagSpecifications', 'createSubnetCidrReservation_tagSpecifications' - The tags to assign to the subnet CIDR reservation.
--
-- 'subnetId', 'createSubnetCidrReservation_subnetId' - The ID of the subnet.
--
-- 'cidr', 'createSubnetCidrReservation_cidr' - The IPv4 or IPV6 CIDR range to reserve.
--
-- 'reservationType', 'createSubnetCidrReservation_reservationType' - The type of reservation.
--
-- The following are valid values:
--
-- -   @prefix@: The Amazon EC2 Prefix Delegation feature assigns the IP
--     addresses to network interfaces that are associated with an
--     instance. For information about Prefix Delegation, see
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-delegation.html Prefix Delegation for Amazon EC2 network interfaces>
--     in the /Amazon Elastic Compute Cloud User Guide/.
--
-- -   @explicit@: You manually assign the IP addresses to resources that
--     reside in your subnet.
newCreateSubnetCidrReservation ::
  -- | 'subnetId'
  Prelude.Text ->
  -- | 'cidr'
  Prelude.Text ->
  -- | 'reservationType'
  SubnetCidrReservationType ->
  CreateSubnetCidrReservation
newCreateSubnetCidrReservation :: Text
-> Text -> SubnetCidrReservationType -> CreateSubnetCidrReservation
newCreateSubnetCidrReservation
  Text
pSubnetId_
  Text
pCidr_
  SubnetCidrReservationType
pReservationType_ =
    CreateSubnetCidrReservation'
      { $sel:description:CreateSubnetCidrReservation' :: Maybe Text
description =
          forall a. Maybe a
Prelude.Nothing,
        $sel:dryRun:CreateSubnetCidrReservation' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
        $sel:tagSpecifications:CreateSubnetCidrReservation' :: Maybe [TagSpecification]
tagSpecifications = forall a. Maybe a
Prelude.Nothing,
        $sel:subnetId:CreateSubnetCidrReservation' :: Text
subnetId = Text
pSubnetId_,
        $sel:cidr:CreateSubnetCidrReservation' :: Text
cidr = Text
pCidr_,
        $sel:reservationType:CreateSubnetCidrReservation' :: SubnetCidrReservationType
reservationType = SubnetCidrReservationType
pReservationType_
      }

-- | The description to assign to the subnet CIDR reservation.
createSubnetCidrReservation_description :: Lens.Lens' CreateSubnetCidrReservation (Prelude.Maybe Prelude.Text)
createSubnetCidrReservation_description :: Lens' CreateSubnetCidrReservation (Maybe Text)
createSubnetCidrReservation_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubnetCidrReservation' {Maybe Text
description :: Maybe Text
$sel:description:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateSubnetCidrReservation
s@CreateSubnetCidrReservation' {} Maybe Text
a -> CreateSubnetCidrReservation
s {$sel:description:CreateSubnetCidrReservation' :: Maybe Text
description = Maybe Text
a} :: CreateSubnetCidrReservation)

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
createSubnetCidrReservation_dryRun :: Lens.Lens' CreateSubnetCidrReservation (Prelude.Maybe Prelude.Bool)
createSubnetCidrReservation_dryRun :: Lens' CreateSubnetCidrReservation (Maybe Bool)
createSubnetCidrReservation_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubnetCidrReservation' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: CreateSubnetCidrReservation
s@CreateSubnetCidrReservation' {} Maybe Bool
a -> CreateSubnetCidrReservation
s {$sel:dryRun:CreateSubnetCidrReservation' :: Maybe Bool
dryRun = Maybe Bool
a} :: CreateSubnetCidrReservation)

-- | The tags to assign to the subnet CIDR reservation.
createSubnetCidrReservation_tagSpecifications :: Lens.Lens' CreateSubnetCidrReservation (Prelude.Maybe [TagSpecification])
createSubnetCidrReservation_tagSpecifications :: Lens' CreateSubnetCidrReservation (Maybe [TagSpecification])
createSubnetCidrReservation_tagSpecifications = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubnetCidrReservation' {Maybe [TagSpecification]
tagSpecifications :: Maybe [TagSpecification]
$sel:tagSpecifications:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Maybe [TagSpecification]
tagSpecifications} -> Maybe [TagSpecification]
tagSpecifications) (\s :: CreateSubnetCidrReservation
s@CreateSubnetCidrReservation' {} Maybe [TagSpecification]
a -> CreateSubnetCidrReservation
s {$sel:tagSpecifications:CreateSubnetCidrReservation' :: Maybe [TagSpecification]
tagSpecifications = Maybe [TagSpecification]
a} :: CreateSubnetCidrReservation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the subnet.
createSubnetCidrReservation_subnetId :: Lens.Lens' CreateSubnetCidrReservation Prelude.Text
createSubnetCidrReservation_subnetId :: Lens' CreateSubnetCidrReservation Text
createSubnetCidrReservation_subnetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubnetCidrReservation' {Text
subnetId :: Text
$sel:subnetId:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Text
subnetId} -> Text
subnetId) (\s :: CreateSubnetCidrReservation
s@CreateSubnetCidrReservation' {} Text
a -> CreateSubnetCidrReservation
s {$sel:subnetId:CreateSubnetCidrReservation' :: Text
subnetId = Text
a} :: CreateSubnetCidrReservation)

-- | The IPv4 or IPV6 CIDR range to reserve.
createSubnetCidrReservation_cidr :: Lens.Lens' CreateSubnetCidrReservation Prelude.Text
createSubnetCidrReservation_cidr :: Lens' CreateSubnetCidrReservation Text
createSubnetCidrReservation_cidr = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubnetCidrReservation' {Text
cidr :: Text
$sel:cidr:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Text
cidr} -> Text
cidr) (\s :: CreateSubnetCidrReservation
s@CreateSubnetCidrReservation' {} Text
a -> CreateSubnetCidrReservation
s {$sel:cidr:CreateSubnetCidrReservation' :: Text
cidr = Text
a} :: CreateSubnetCidrReservation)

-- | The type of reservation.
--
-- The following are valid values:
--
-- -   @prefix@: The Amazon EC2 Prefix Delegation feature assigns the IP
--     addresses to network interfaces that are associated with an
--     instance. For information about Prefix Delegation, see
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-delegation.html Prefix Delegation for Amazon EC2 network interfaces>
--     in the /Amazon Elastic Compute Cloud User Guide/.
--
-- -   @explicit@: You manually assign the IP addresses to resources that
--     reside in your subnet.
createSubnetCidrReservation_reservationType :: Lens.Lens' CreateSubnetCidrReservation SubnetCidrReservationType
createSubnetCidrReservation_reservationType :: Lens' CreateSubnetCidrReservation SubnetCidrReservationType
createSubnetCidrReservation_reservationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubnetCidrReservation' {SubnetCidrReservationType
reservationType :: SubnetCidrReservationType
$sel:reservationType:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> SubnetCidrReservationType
reservationType} -> SubnetCidrReservationType
reservationType) (\s :: CreateSubnetCidrReservation
s@CreateSubnetCidrReservation' {} SubnetCidrReservationType
a -> CreateSubnetCidrReservation
s {$sel:reservationType:CreateSubnetCidrReservation' :: SubnetCidrReservationType
reservationType = SubnetCidrReservationType
a} :: CreateSubnetCidrReservation)

instance Core.AWSRequest CreateSubnetCidrReservation where
  type
    AWSResponse CreateSubnetCidrReservation =
      CreateSubnetCidrReservationResponse
  request :: (Service -> Service)
-> CreateSubnetCidrReservation
-> Request CreateSubnetCidrReservation
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateSubnetCidrReservation
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateSubnetCidrReservation)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe SubnetCidrReservation
-> Int -> CreateSubnetCidrReservationResponse
CreateSubnetCidrReservationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"subnetCidrReservation")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateSubnetCidrReservation where
  hashWithSalt :: Int -> CreateSubnetCidrReservation -> Int
hashWithSalt Int
_salt CreateSubnetCidrReservation' {Maybe Bool
Maybe [TagSpecification]
Maybe Text
Text
SubnetCidrReservationType
reservationType :: SubnetCidrReservationType
cidr :: Text
subnetId :: Text
tagSpecifications :: Maybe [TagSpecification]
dryRun :: Maybe Bool
description :: Maybe Text
$sel:reservationType:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> SubnetCidrReservationType
$sel:cidr:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Text
$sel:subnetId:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Text
$sel:tagSpecifications:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Maybe [TagSpecification]
$sel:dryRun:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Maybe Bool
$sel:description:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TagSpecification]
tagSpecifications
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
subnetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
cidr
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SubnetCidrReservationType
reservationType

instance Prelude.NFData CreateSubnetCidrReservation where
  rnf :: CreateSubnetCidrReservation -> ()
rnf CreateSubnetCidrReservation' {Maybe Bool
Maybe [TagSpecification]
Maybe Text
Text
SubnetCidrReservationType
reservationType :: SubnetCidrReservationType
cidr :: Text
subnetId :: Text
tagSpecifications :: Maybe [TagSpecification]
dryRun :: Maybe Bool
description :: Maybe Text
$sel:reservationType:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> SubnetCidrReservationType
$sel:cidr:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Text
$sel:subnetId:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Text
$sel:tagSpecifications:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Maybe [TagSpecification]
$sel:dryRun:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Maybe Bool
$sel:description:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TagSpecification]
tagSpecifications
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
subnetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
cidr
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SubnetCidrReservationType
reservationType

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

instance Data.ToPath CreateSubnetCidrReservation where
  toPath :: CreateSubnetCidrReservation -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery CreateSubnetCidrReservation where
  toQuery :: CreateSubnetCidrReservation -> QueryString
toQuery CreateSubnetCidrReservation' {Maybe Bool
Maybe [TagSpecification]
Maybe Text
Text
SubnetCidrReservationType
reservationType :: SubnetCidrReservationType
cidr :: Text
subnetId :: Text
tagSpecifications :: Maybe [TagSpecification]
dryRun :: Maybe Bool
description :: Maybe Text
$sel:reservationType:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> SubnetCidrReservationType
$sel:cidr:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Text
$sel:subnetId:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Text
$sel:tagSpecifications:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Maybe [TagSpecification]
$sel:dryRun:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Maybe Bool
$sel:description:CreateSubnetCidrReservation' :: CreateSubnetCidrReservation -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"CreateSubnetCidrReservation" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"Description" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
description,
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagSpecification"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagSpecification]
tagSpecifications
          ),
        ByteString
"SubnetId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
subnetId,
        ByteString
"Cidr" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
cidr,
        ByteString
"ReservationType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: SubnetCidrReservationType
reservationType
      ]

-- | /See:/ 'newCreateSubnetCidrReservationResponse' smart constructor.
data CreateSubnetCidrReservationResponse = CreateSubnetCidrReservationResponse'
  { -- | Information about the created subnet CIDR reservation.
    CreateSubnetCidrReservationResponse -> Maybe SubnetCidrReservation
subnetCidrReservation :: Prelude.Maybe SubnetCidrReservation,
    -- | The response's http status code.
    CreateSubnetCidrReservationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateSubnetCidrReservationResponse
-> CreateSubnetCidrReservationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSubnetCidrReservationResponse
-> CreateSubnetCidrReservationResponse -> Bool
$c/= :: CreateSubnetCidrReservationResponse
-> CreateSubnetCidrReservationResponse -> Bool
== :: CreateSubnetCidrReservationResponse
-> CreateSubnetCidrReservationResponse -> Bool
$c== :: CreateSubnetCidrReservationResponse
-> CreateSubnetCidrReservationResponse -> Bool
Prelude.Eq, ReadPrec [CreateSubnetCidrReservationResponse]
ReadPrec CreateSubnetCidrReservationResponse
Int -> ReadS CreateSubnetCidrReservationResponse
ReadS [CreateSubnetCidrReservationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSubnetCidrReservationResponse]
$creadListPrec :: ReadPrec [CreateSubnetCidrReservationResponse]
readPrec :: ReadPrec CreateSubnetCidrReservationResponse
$creadPrec :: ReadPrec CreateSubnetCidrReservationResponse
readList :: ReadS [CreateSubnetCidrReservationResponse]
$creadList :: ReadS [CreateSubnetCidrReservationResponse]
readsPrec :: Int -> ReadS CreateSubnetCidrReservationResponse
$creadsPrec :: Int -> ReadS CreateSubnetCidrReservationResponse
Prelude.Read, Int -> CreateSubnetCidrReservationResponse -> ShowS
[CreateSubnetCidrReservationResponse] -> ShowS
CreateSubnetCidrReservationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSubnetCidrReservationResponse] -> ShowS
$cshowList :: [CreateSubnetCidrReservationResponse] -> ShowS
show :: CreateSubnetCidrReservationResponse -> String
$cshow :: CreateSubnetCidrReservationResponse -> String
showsPrec :: Int -> CreateSubnetCidrReservationResponse -> ShowS
$cshowsPrec :: Int -> CreateSubnetCidrReservationResponse -> ShowS
Prelude.Show, forall x.
Rep CreateSubnetCidrReservationResponse x
-> CreateSubnetCidrReservationResponse
forall x.
CreateSubnetCidrReservationResponse
-> Rep CreateSubnetCidrReservationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateSubnetCidrReservationResponse x
-> CreateSubnetCidrReservationResponse
$cfrom :: forall x.
CreateSubnetCidrReservationResponse
-> Rep CreateSubnetCidrReservationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateSubnetCidrReservationResponse' 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:
--
-- 'subnetCidrReservation', 'createSubnetCidrReservationResponse_subnetCidrReservation' - Information about the created subnet CIDR reservation.
--
-- 'httpStatus', 'createSubnetCidrReservationResponse_httpStatus' - The response's http status code.
newCreateSubnetCidrReservationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateSubnetCidrReservationResponse
newCreateSubnetCidrReservationResponse :: Int -> CreateSubnetCidrReservationResponse
newCreateSubnetCidrReservationResponse Int
pHttpStatus_ =
  CreateSubnetCidrReservationResponse'
    { $sel:subnetCidrReservation:CreateSubnetCidrReservationResponse' :: Maybe SubnetCidrReservation
subnetCidrReservation =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateSubnetCidrReservationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the created subnet CIDR reservation.
createSubnetCidrReservationResponse_subnetCidrReservation :: Lens.Lens' CreateSubnetCidrReservationResponse (Prelude.Maybe SubnetCidrReservation)
createSubnetCidrReservationResponse_subnetCidrReservation :: Lens'
  CreateSubnetCidrReservationResponse (Maybe SubnetCidrReservation)
createSubnetCidrReservationResponse_subnetCidrReservation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubnetCidrReservationResponse' {Maybe SubnetCidrReservation
subnetCidrReservation :: Maybe SubnetCidrReservation
$sel:subnetCidrReservation:CreateSubnetCidrReservationResponse' :: CreateSubnetCidrReservationResponse -> Maybe SubnetCidrReservation
subnetCidrReservation} -> Maybe SubnetCidrReservation
subnetCidrReservation) (\s :: CreateSubnetCidrReservationResponse
s@CreateSubnetCidrReservationResponse' {} Maybe SubnetCidrReservation
a -> CreateSubnetCidrReservationResponse
s {$sel:subnetCidrReservation:CreateSubnetCidrReservationResponse' :: Maybe SubnetCidrReservation
subnetCidrReservation = Maybe SubnetCidrReservation
a} :: CreateSubnetCidrReservationResponse)

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

instance
  Prelude.NFData
    CreateSubnetCidrReservationResponse
  where
  rnf :: CreateSubnetCidrReservationResponse -> ()
rnf CreateSubnetCidrReservationResponse' {Int
Maybe SubnetCidrReservation
httpStatus :: Int
subnetCidrReservation :: Maybe SubnetCidrReservation
$sel:httpStatus:CreateSubnetCidrReservationResponse' :: CreateSubnetCidrReservationResponse -> Int
$sel:subnetCidrReservation:CreateSubnetCidrReservationResponse' :: CreateSubnetCidrReservationResponse -> Maybe SubnetCidrReservation
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe SubnetCidrReservation
subnetCidrReservation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus