{-# 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.CreateIpamPool
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Create an IP address pool for Amazon VPC IP Address Manager (IPAM). In
-- IPAM, a pool is a collection of contiguous IP addresses CIDRs. Pools
-- enable you to organize your IP addresses according to your routing and
-- security needs. For example, if you have separate routing and security
-- needs for development and production applications, you can create a pool
-- for each.
--
-- For more information, see
-- <https://docs.aws.amazon.com/vpc/latest/ipam/create-top-ipam.html Create a top-level pool>
-- in the /Amazon VPC IPAM User Guide/.
module Amazonka.EC2.CreateIpamPool
  ( -- * Creating a Request
    CreateIpamPool (..),
    newCreateIpamPool,

    -- * Request Lenses
    createIpamPool_allocationDefaultNetmaskLength,
    createIpamPool_allocationMaxNetmaskLength,
    createIpamPool_allocationMinNetmaskLength,
    createIpamPool_allocationResourceTags,
    createIpamPool_autoImport,
    createIpamPool_awsService,
    createIpamPool_clientToken,
    createIpamPool_description,
    createIpamPool_dryRun,
    createIpamPool_locale,
    createIpamPool_publiclyAdvertisable,
    createIpamPool_sourceIpamPoolId,
    createIpamPool_tagSpecifications,
    createIpamPool_ipamScopeId,
    createIpamPool_addressFamily,

    -- * Destructuring the Response
    CreateIpamPoolResponse (..),
    newCreateIpamPoolResponse,

    -- * Response Lenses
    createIpamPoolResponse_ipamPool,
    createIpamPoolResponse_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:/ 'newCreateIpamPool' smart constructor.
data CreateIpamPool = CreateIpamPool'
  { -- | The default netmask length for allocations added to this pool. If, for
    -- example, the CIDR assigned to this pool is 10.0.0.0\/8 and you enter 16
    -- here, new allocations will default to 10.0.0.0\/16.
    CreateIpamPool -> Maybe Natural
allocationDefaultNetmaskLength :: Prelude.Maybe Prelude.Natural,
    -- | The maximum netmask length possible for CIDR allocations in this IPAM
    -- pool to be compliant. The maximum netmask length must be greater than
    -- the minimum netmask length. Possible netmask lengths for IPv4 addresses
    -- are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.
    CreateIpamPool -> Maybe Natural
allocationMaxNetmaskLength :: Prelude.Maybe Prelude.Natural,
    -- | The minimum netmask length required for CIDR allocations in this IPAM
    -- pool to be compliant. The minimum netmask length must be less than the
    -- maximum netmask length. Possible netmask lengths for IPv4 addresses are
    -- 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.
    CreateIpamPool -> Maybe Natural
allocationMinNetmaskLength :: Prelude.Maybe Prelude.Natural,
    -- | Tags that are required for resources that use CIDRs from this IPAM pool.
    -- Resources that do not have these tags will not be allowed to allocate
    -- space from the pool. If the resources have their tags changed after they
    -- have allocated space or if the allocation tagging requirements are
    -- changed on the pool, the resource may be marked as noncompliant.
    CreateIpamPool -> Maybe [RequestIpamResourceTag]
allocationResourceTags :: Prelude.Maybe [RequestIpamResourceTag],
    -- | If selected, IPAM will continuously look for resources within the CIDR
    -- range of this pool and automatically import them as allocations into
    -- your IPAM. The CIDRs that will be allocated for these resources must not
    -- already be allocated to other resources in order for the import to
    -- succeed. IPAM will import a CIDR regardless of its compliance with the
    -- pool\'s allocation rules, so a resource might be imported and
    -- subsequently marked as noncompliant. If IPAM discovers multiple CIDRs
    -- that overlap, IPAM will import the largest CIDR only. If IPAM discovers
    -- multiple CIDRs with matching CIDRs, IPAM will randomly import one of
    -- them only.
    --
    -- A locale must be set on the pool for this feature to work.
    CreateIpamPool -> Maybe Bool
autoImport :: Prelude.Maybe Prelude.Bool,
    -- | Limits which service in Amazon Web Services that the pool can be used
    -- in. \"ec2\", for example, allows users to use space for Elastic IP
    -- addresses and VPCs.
    CreateIpamPool -> Maybe IpamPoolAwsService
awsService :: Prelude.Maybe IpamPoolAwsService,
    -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html Ensuring Idempotency>.
    CreateIpamPool -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | A description for the IPAM pool.
    CreateIpamPool -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A check for 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@.
    CreateIpamPool -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | In IPAM, the locale is the Amazon Web Services Region where you want to
    -- make an IPAM pool available for allocations. Only resources in the same
    -- Region as the locale of the pool can get IP address allocations from the
    -- pool. You can only allocate a CIDR for a VPC, for example, from an IPAM
    -- pool that shares a locale with the VPC’s Region. Note that once you
    -- choose a Locale for a pool, you cannot modify it. If you do not choose a
    -- locale, resources in Regions others than the IPAM\'s home region cannot
    -- use CIDRs from this pool.
    --
    -- Possible values: Any Amazon Web Services Region, such as us-east-1.
    CreateIpamPool -> Maybe Text
locale :: Prelude.Maybe Prelude.Text,
    -- | Determines if the pool is publicly advertisable. This option is not
    -- available for pools with AddressFamily set to @ipv4@.
    CreateIpamPool -> Maybe Bool
publiclyAdvertisable :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the source IPAM pool. Use this option to create a pool within
    -- an existing pool. Note that the CIDR you provision for the pool within
    -- the source pool must be available in the source pool\'s CIDR range.
    CreateIpamPool -> Maybe Text
sourceIpamPoolId :: Prelude.Maybe Prelude.Text,
    -- | The key\/value combination of a tag assigned to the resource. Use the
    -- tag key in the filter name and the tag value as the filter value. For
    -- example, to find all resources that have a tag with the key @Owner@ and
    -- the value @TeamA@, specify @tag:Owner@ for the filter name and @TeamA@
    -- for the filter value.
    CreateIpamPool -> Maybe [TagSpecification]
tagSpecifications :: Prelude.Maybe [TagSpecification],
    -- | The ID of the scope in which you would like to create the IPAM pool.
    CreateIpamPool -> Text
ipamScopeId :: Prelude.Text,
    -- | The IP protocol assigned to this IPAM pool. You must choose either IPv4
    -- or IPv6 protocol for a pool.
    CreateIpamPool -> AddressFamily
addressFamily :: AddressFamily
  }
  deriving (CreateIpamPool -> CreateIpamPool -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateIpamPool -> CreateIpamPool -> Bool
$c/= :: CreateIpamPool -> CreateIpamPool -> Bool
== :: CreateIpamPool -> CreateIpamPool -> Bool
$c== :: CreateIpamPool -> CreateIpamPool -> Bool
Prelude.Eq, ReadPrec [CreateIpamPool]
ReadPrec CreateIpamPool
Int -> ReadS CreateIpamPool
ReadS [CreateIpamPool]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateIpamPool]
$creadListPrec :: ReadPrec [CreateIpamPool]
readPrec :: ReadPrec CreateIpamPool
$creadPrec :: ReadPrec CreateIpamPool
readList :: ReadS [CreateIpamPool]
$creadList :: ReadS [CreateIpamPool]
readsPrec :: Int -> ReadS CreateIpamPool
$creadsPrec :: Int -> ReadS CreateIpamPool
Prelude.Read, Int -> CreateIpamPool -> ShowS
[CreateIpamPool] -> ShowS
CreateIpamPool -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateIpamPool] -> ShowS
$cshowList :: [CreateIpamPool] -> ShowS
show :: CreateIpamPool -> String
$cshow :: CreateIpamPool -> String
showsPrec :: Int -> CreateIpamPool -> ShowS
$cshowsPrec :: Int -> CreateIpamPool -> ShowS
Prelude.Show, forall x. Rep CreateIpamPool x -> CreateIpamPool
forall x. CreateIpamPool -> Rep CreateIpamPool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateIpamPool x -> CreateIpamPool
$cfrom :: forall x. CreateIpamPool -> Rep CreateIpamPool x
Prelude.Generic)

-- |
-- Create a value of 'CreateIpamPool' 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:
--
-- 'allocationDefaultNetmaskLength', 'createIpamPool_allocationDefaultNetmaskLength' - The default netmask length for allocations added to this pool. If, for
-- example, the CIDR assigned to this pool is 10.0.0.0\/8 and you enter 16
-- here, new allocations will default to 10.0.0.0\/16.
--
-- 'allocationMaxNetmaskLength', 'createIpamPool_allocationMaxNetmaskLength' - The maximum netmask length possible for CIDR allocations in this IPAM
-- pool to be compliant. The maximum netmask length must be greater than
-- the minimum netmask length. Possible netmask lengths for IPv4 addresses
-- are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.
--
-- 'allocationMinNetmaskLength', 'createIpamPool_allocationMinNetmaskLength' - The minimum netmask length required for CIDR allocations in this IPAM
-- pool to be compliant. The minimum netmask length must be less than the
-- maximum netmask length. Possible netmask lengths for IPv4 addresses are
-- 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.
--
-- 'allocationResourceTags', 'createIpamPool_allocationResourceTags' - Tags that are required for resources that use CIDRs from this IPAM pool.
-- Resources that do not have these tags will not be allowed to allocate
-- space from the pool. If the resources have their tags changed after they
-- have allocated space or if the allocation tagging requirements are
-- changed on the pool, the resource may be marked as noncompliant.
--
-- 'autoImport', 'createIpamPool_autoImport' - If selected, IPAM will continuously look for resources within the CIDR
-- range of this pool and automatically import them as allocations into
-- your IPAM. The CIDRs that will be allocated for these resources must not
-- already be allocated to other resources in order for the import to
-- succeed. IPAM will import a CIDR regardless of its compliance with the
-- pool\'s allocation rules, so a resource might be imported and
-- subsequently marked as noncompliant. If IPAM discovers multiple CIDRs
-- that overlap, IPAM will import the largest CIDR only. If IPAM discovers
-- multiple CIDRs with matching CIDRs, IPAM will randomly import one of
-- them only.
--
-- A locale must be set on the pool for this feature to work.
--
-- 'awsService', 'createIpamPool_awsService' - Limits which service in Amazon Web Services that the pool can be used
-- in. \"ec2\", for example, allows users to use space for Elastic IP
-- addresses and VPCs.
--
-- 'clientToken', 'createIpamPool_clientToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html Ensuring Idempotency>.
--
-- 'description', 'createIpamPool_description' - A description for the IPAM pool.
--
-- 'dryRun', 'createIpamPool_dryRun' - A check for 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@.
--
-- 'locale', 'createIpamPool_locale' - In IPAM, the locale is the Amazon Web Services Region where you want to
-- make an IPAM pool available for allocations. Only resources in the same
-- Region as the locale of the pool can get IP address allocations from the
-- pool. You can only allocate a CIDR for a VPC, for example, from an IPAM
-- pool that shares a locale with the VPC’s Region. Note that once you
-- choose a Locale for a pool, you cannot modify it. If you do not choose a
-- locale, resources in Regions others than the IPAM\'s home region cannot
-- use CIDRs from this pool.
--
-- Possible values: Any Amazon Web Services Region, such as us-east-1.
--
-- 'publiclyAdvertisable', 'createIpamPool_publiclyAdvertisable' - Determines if the pool is publicly advertisable. This option is not
-- available for pools with AddressFamily set to @ipv4@.
--
-- 'sourceIpamPoolId', 'createIpamPool_sourceIpamPoolId' - The ID of the source IPAM pool. Use this option to create a pool within
-- an existing pool. Note that the CIDR you provision for the pool within
-- the source pool must be available in the source pool\'s CIDR range.
--
-- 'tagSpecifications', 'createIpamPool_tagSpecifications' - The key\/value combination of a tag assigned to the resource. Use the
-- tag key in the filter name and the tag value as the filter value. For
-- example, to find all resources that have a tag with the key @Owner@ and
-- the value @TeamA@, specify @tag:Owner@ for the filter name and @TeamA@
-- for the filter value.
--
-- 'ipamScopeId', 'createIpamPool_ipamScopeId' - The ID of the scope in which you would like to create the IPAM pool.
--
-- 'addressFamily', 'createIpamPool_addressFamily' - The IP protocol assigned to this IPAM pool. You must choose either IPv4
-- or IPv6 protocol for a pool.
newCreateIpamPool ::
  -- | 'ipamScopeId'
  Prelude.Text ->
  -- | 'addressFamily'
  AddressFamily ->
  CreateIpamPool
newCreateIpamPool :: Text -> AddressFamily -> CreateIpamPool
newCreateIpamPool Text
pIpamScopeId_ AddressFamily
pAddressFamily_ =
  CreateIpamPool'
    { $sel:allocationDefaultNetmaskLength:CreateIpamPool' :: Maybe Natural
allocationDefaultNetmaskLength =
        forall a. Maybe a
Prelude.Nothing,
      $sel:allocationMaxNetmaskLength:CreateIpamPool' :: Maybe Natural
allocationMaxNetmaskLength = forall a. Maybe a
Prelude.Nothing,
      $sel:allocationMinNetmaskLength:CreateIpamPool' :: Maybe Natural
allocationMinNetmaskLength = forall a. Maybe a
Prelude.Nothing,
      $sel:allocationResourceTags:CreateIpamPool' :: Maybe [RequestIpamResourceTag]
allocationResourceTags = forall a. Maybe a
Prelude.Nothing,
      $sel:autoImport:CreateIpamPool' :: Maybe Bool
autoImport = forall a. Maybe a
Prelude.Nothing,
      $sel:awsService:CreateIpamPool' :: Maybe IpamPoolAwsService
awsService = forall a. Maybe a
Prelude.Nothing,
      $sel:clientToken:CreateIpamPool' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateIpamPool' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:CreateIpamPool' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:locale:CreateIpamPool' :: Maybe Text
locale = forall a. Maybe a
Prelude.Nothing,
      $sel:publiclyAdvertisable:CreateIpamPool' :: Maybe Bool
publiclyAdvertisable = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceIpamPoolId:CreateIpamPool' :: Maybe Text
sourceIpamPoolId = forall a. Maybe a
Prelude.Nothing,
      $sel:tagSpecifications:CreateIpamPool' :: Maybe [TagSpecification]
tagSpecifications = forall a. Maybe a
Prelude.Nothing,
      $sel:ipamScopeId:CreateIpamPool' :: Text
ipamScopeId = Text
pIpamScopeId_,
      $sel:addressFamily:CreateIpamPool' :: AddressFamily
addressFamily = AddressFamily
pAddressFamily_
    }

-- | The default netmask length for allocations added to this pool. If, for
-- example, the CIDR assigned to this pool is 10.0.0.0\/8 and you enter 16
-- here, new allocations will default to 10.0.0.0\/16.
createIpamPool_allocationDefaultNetmaskLength :: Lens.Lens' CreateIpamPool (Prelude.Maybe Prelude.Natural)
createIpamPool_allocationDefaultNetmaskLength :: Lens' CreateIpamPool (Maybe Natural)
createIpamPool_allocationDefaultNetmaskLength = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Maybe Natural
allocationDefaultNetmaskLength :: Maybe Natural
$sel:allocationDefaultNetmaskLength:CreateIpamPool' :: CreateIpamPool -> Maybe Natural
allocationDefaultNetmaskLength} -> Maybe Natural
allocationDefaultNetmaskLength) (\s :: CreateIpamPool
s@CreateIpamPool' {} Maybe Natural
a -> CreateIpamPool
s {$sel:allocationDefaultNetmaskLength:CreateIpamPool' :: Maybe Natural
allocationDefaultNetmaskLength = Maybe Natural
a} :: CreateIpamPool)

-- | The maximum netmask length possible for CIDR allocations in this IPAM
-- pool to be compliant. The maximum netmask length must be greater than
-- the minimum netmask length. Possible netmask lengths for IPv4 addresses
-- are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.
createIpamPool_allocationMaxNetmaskLength :: Lens.Lens' CreateIpamPool (Prelude.Maybe Prelude.Natural)
createIpamPool_allocationMaxNetmaskLength :: Lens' CreateIpamPool (Maybe Natural)
createIpamPool_allocationMaxNetmaskLength = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Maybe Natural
allocationMaxNetmaskLength :: Maybe Natural
$sel:allocationMaxNetmaskLength:CreateIpamPool' :: CreateIpamPool -> Maybe Natural
allocationMaxNetmaskLength} -> Maybe Natural
allocationMaxNetmaskLength) (\s :: CreateIpamPool
s@CreateIpamPool' {} Maybe Natural
a -> CreateIpamPool
s {$sel:allocationMaxNetmaskLength:CreateIpamPool' :: Maybe Natural
allocationMaxNetmaskLength = Maybe Natural
a} :: CreateIpamPool)

-- | The minimum netmask length required for CIDR allocations in this IPAM
-- pool to be compliant. The minimum netmask length must be less than the
-- maximum netmask length. Possible netmask lengths for IPv4 addresses are
-- 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.
createIpamPool_allocationMinNetmaskLength :: Lens.Lens' CreateIpamPool (Prelude.Maybe Prelude.Natural)
createIpamPool_allocationMinNetmaskLength :: Lens' CreateIpamPool (Maybe Natural)
createIpamPool_allocationMinNetmaskLength = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Maybe Natural
allocationMinNetmaskLength :: Maybe Natural
$sel:allocationMinNetmaskLength:CreateIpamPool' :: CreateIpamPool -> Maybe Natural
allocationMinNetmaskLength} -> Maybe Natural
allocationMinNetmaskLength) (\s :: CreateIpamPool
s@CreateIpamPool' {} Maybe Natural
a -> CreateIpamPool
s {$sel:allocationMinNetmaskLength:CreateIpamPool' :: Maybe Natural
allocationMinNetmaskLength = Maybe Natural
a} :: CreateIpamPool)

-- | Tags that are required for resources that use CIDRs from this IPAM pool.
-- Resources that do not have these tags will not be allowed to allocate
-- space from the pool. If the resources have their tags changed after they
-- have allocated space or if the allocation tagging requirements are
-- changed on the pool, the resource may be marked as noncompliant.
createIpamPool_allocationResourceTags :: Lens.Lens' CreateIpamPool (Prelude.Maybe [RequestIpamResourceTag])
createIpamPool_allocationResourceTags :: Lens' CreateIpamPool (Maybe [RequestIpamResourceTag])
createIpamPool_allocationResourceTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Maybe [RequestIpamResourceTag]
allocationResourceTags :: Maybe [RequestIpamResourceTag]
$sel:allocationResourceTags:CreateIpamPool' :: CreateIpamPool -> Maybe [RequestIpamResourceTag]
allocationResourceTags} -> Maybe [RequestIpamResourceTag]
allocationResourceTags) (\s :: CreateIpamPool
s@CreateIpamPool' {} Maybe [RequestIpamResourceTag]
a -> CreateIpamPool
s {$sel:allocationResourceTags:CreateIpamPool' :: Maybe [RequestIpamResourceTag]
allocationResourceTags = Maybe [RequestIpamResourceTag]
a} :: CreateIpamPool) 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

-- | If selected, IPAM will continuously look for resources within the CIDR
-- range of this pool and automatically import them as allocations into
-- your IPAM. The CIDRs that will be allocated for these resources must not
-- already be allocated to other resources in order for the import to
-- succeed. IPAM will import a CIDR regardless of its compliance with the
-- pool\'s allocation rules, so a resource might be imported and
-- subsequently marked as noncompliant. If IPAM discovers multiple CIDRs
-- that overlap, IPAM will import the largest CIDR only. If IPAM discovers
-- multiple CIDRs with matching CIDRs, IPAM will randomly import one of
-- them only.
--
-- A locale must be set on the pool for this feature to work.
createIpamPool_autoImport :: Lens.Lens' CreateIpamPool (Prelude.Maybe Prelude.Bool)
createIpamPool_autoImport :: Lens' CreateIpamPool (Maybe Bool)
createIpamPool_autoImport = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Maybe Bool
autoImport :: Maybe Bool
$sel:autoImport:CreateIpamPool' :: CreateIpamPool -> Maybe Bool
autoImport} -> Maybe Bool
autoImport) (\s :: CreateIpamPool
s@CreateIpamPool' {} Maybe Bool
a -> CreateIpamPool
s {$sel:autoImport:CreateIpamPool' :: Maybe Bool
autoImport = Maybe Bool
a} :: CreateIpamPool)

-- | Limits which service in Amazon Web Services that the pool can be used
-- in. \"ec2\", for example, allows users to use space for Elastic IP
-- addresses and VPCs.
createIpamPool_awsService :: Lens.Lens' CreateIpamPool (Prelude.Maybe IpamPoolAwsService)
createIpamPool_awsService :: Lens' CreateIpamPool (Maybe IpamPoolAwsService)
createIpamPool_awsService = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Maybe IpamPoolAwsService
awsService :: Maybe IpamPoolAwsService
$sel:awsService:CreateIpamPool' :: CreateIpamPool -> Maybe IpamPoolAwsService
awsService} -> Maybe IpamPoolAwsService
awsService) (\s :: CreateIpamPool
s@CreateIpamPool' {} Maybe IpamPoolAwsService
a -> CreateIpamPool
s {$sel:awsService:CreateIpamPool' :: Maybe IpamPoolAwsService
awsService = Maybe IpamPoolAwsService
a} :: CreateIpamPool)

-- | A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html Ensuring Idempotency>.
createIpamPool_clientToken :: Lens.Lens' CreateIpamPool (Prelude.Maybe Prelude.Text)
createIpamPool_clientToken :: Lens' CreateIpamPool (Maybe Text)
createIpamPool_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateIpamPool' :: CreateIpamPool -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateIpamPool
s@CreateIpamPool' {} Maybe Text
a -> CreateIpamPool
s {$sel:clientToken:CreateIpamPool' :: Maybe Text
clientToken = Maybe Text
a} :: CreateIpamPool)

-- | A description for the IPAM pool.
createIpamPool_description :: Lens.Lens' CreateIpamPool (Prelude.Maybe Prelude.Text)
createIpamPool_description :: Lens' CreateIpamPool (Maybe Text)
createIpamPool_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Maybe Text
description :: Maybe Text
$sel:description:CreateIpamPool' :: CreateIpamPool -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateIpamPool
s@CreateIpamPool' {} Maybe Text
a -> CreateIpamPool
s {$sel:description:CreateIpamPool' :: Maybe Text
description = Maybe Text
a} :: CreateIpamPool)

-- | A check for 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@.
createIpamPool_dryRun :: Lens.Lens' CreateIpamPool (Prelude.Maybe Prelude.Bool)
createIpamPool_dryRun :: Lens' CreateIpamPool (Maybe Bool)
createIpamPool_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:CreateIpamPool' :: CreateIpamPool -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: CreateIpamPool
s@CreateIpamPool' {} Maybe Bool
a -> CreateIpamPool
s {$sel:dryRun:CreateIpamPool' :: Maybe Bool
dryRun = Maybe Bool
a} :: CreateIpamPool)

-- | In IPAM, the locale is the Amazon Web Services Region where you want to
-- make an IPAM pool available for allocations. Only resources in the same
-- Region as the locale of the pool can get IP address allocations from the
-- pool. You can only allocate a CIDR for a VPC, for example, from an IPAM
-- pool that shares a locale with the VPC’s Region. Note that once you
-- choose a Locale for a pool, you cannot modify it. If you do not choose a
-- locale, resources in Regions others than the IPAM\'s home region cannot
-- use CIDRs from this pool.
--
-- Possible values: Any Amazon Web Services Region, such as us-east-1.
createIpamPool_locale :: Lens.Lens' CreateIpamPool (Prelude.Maybe Prelude.Text)
createIpamPool_locale :: Lens' CreateIpamPool (Maybe Text)
createIpamPool_locale = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Maybe Text
locale :: Maybe Text
$sel:locale:CreateIpamPool' :: CreateIpamPool -> Maybe Text
locale} -> Maybe Text
locale) (\s :: CreateIpamPool
s@CreateIpamPool' {} Maybe Text
a -> CreateIpamPool
s {$sel:locale:CreateIpamPool' :: Maybe Text
locale = Maybe Text
a} :: CreateIpamPool)

-- | Determines if the pool is publicly advertisable. This option is not
-- available for pools with AddressFamily set to @ipv4@.
createIpamPool_publiclyAdvertisable :: Lens.Lens' CreateIpamPool (Prelude.Maybe Prelude.Bool)
createIpamPool_publiclyAdvertisable :: Lens' CreateIpamPool (Maybe Bool)
createIpamPool_publiclyAdvertisable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Maybe Bool
publiclyAdvertisable :: Maybe Bool
$sel:publiclyAdvertisable:CreateIpamPool' :: CreateIpamPool -> Maybe Bool
publiclyAdvertisable} -> Maybe Bool
publiclyAdvertisable) (\s :: CreateIpamPool
s@CreateIpamPool' {} Maybe Bool
a -> CreateIpamPool
s {$sel:publiclyAdvertisable:CreateIpamPool' :: Maybe Bool
publiclyAdvertisable = Maybe Bool
a} :: CreateIpamPool)

-- | The ID of the source IPAM pool. Use this option to create a pool within
-- an existing pool. Note that the CIDR you provision for the pool within
-- the source pool must be available in the source pool\'s CIDR range.
createIpamPool_sourceIpamPoolId :: Lens.Lens' CreateIpamPool (Prelude.Maybe Prelude.Text)
createIpamPool_sourceIpamPoolId :: Lens' CreateIpamPool (Maybe Text)
createIpamPool_sourceIpamPoolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Maybe Text
sourceIpamPoolId :: Maybe Text
$sel:sourceIpamPoolId:CreateIpamPool' :: CreateIpamPool -> Maybe Text
sourceIpamPoolId} -> Maybe Text
sourceIpamPoolId) (\s :: CreateIpamPool
s@CreateIpamPool' {} Maybe Text
a -> CreateIpamPool
s {$sel:sourceIpamPoolId:CreateIpamPool' :: Maybe Text
sourceIpamPoolId = Maybe Text
a} :: CreateIpamPool)

-- | The key\/value combination of a tag assigned to the resource. Use the
-- tag key in the filter name and the tag value as the filter value. For
-- example, to find all resources that have a tag with the key @Owner@ and
-- the value @TeamA@, specify @tag:Owner@ for the filter name and @TeamA@
-- for the filter value.
createIpamPool_tagSpecifications :: Lens.Lens' CreateIpamPool (Prelude.Maybe [TagSpecification])
createIpamPool_tagSpecifications :: Lens' CreateIpamPool (Maybe [TagSpecification])
createIpamPool_tagSpecifications = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Maybe [TagSpecification]
tagSpecifications :: Maybe [TagSpecification]
$sel:tagSpecifications:CreateIpamPool' :: CreateIpamPool -> Maybe [TagSpecification]
tagSpecifications} -> Maybe [TagSpecification]
tagSpecifications) (\s :: CreateIpamPool
s@CreateIpamPool' {} Maybe [TagSpecification]
a -> CreateIpamPool
s {$sel:tagSpecifications:CreateIpamPool' :: Maybe [TagSpecification]
tagSpecifications = Maybe [TagSpecification]
a} :: CreateIpamPool) 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 scope in which you would like to create the IPAM pool.
createIpamPool_ipamScopeId :: Lens.Lens' CreateIpamPool Prelude.Text
createIpamPool_ipamScopeId :: Lens' CreateIpamPool Text
createIpamPool_ipamScopeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {Text
ipamScopeId :: Text
$sel:ipamScopeId:CreateIpamPool' :: CreateIpamPool -> Text
ipamScopeId} -> Text
ipamScopeId) (\s :: CreateIpamPool
s@CreateIpamPool' {} Text
a -> CreateIpamPool
s {$sel:ipamScopeId:CreateIpamPool' :: Text
ipamScopeId = Text
a} :: CreateIpamPool)

-- | The IP protocol assigned to this IPAM pool. You must choose either IPv4
-- or IPv6 protocol for a pool.
createIpamPool_addressFamily :: Lens.Lens' CreateIpamPool AddressFamily
createIpamPool_addressFamily :: Lens' CreateIpamPool AddressFamily
createIpamPool_addressFamily = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPool' {AddressFamily
addressFamily :: AddressFamily
$sel:addressFamily:CreateIpamPool' :: CreateIpamPool -> AddressFamily
addressFamily} -> AddressFamily
addressFamily) (\s :: CreateIpamPool
s@CreateIpamPool' {} AddressFamily
a -> CreateIpamPool
s {$sel:addressFamily:CreateIpamPool' :: AddressFamily
addressFamily = AddressFamily
a} :: CreateIpamPool)

instance Core.AWSRequest CreateIpamPool where
  type
    AWSResponse CreateIpamPool =
      CreateIpamPoolResponse
  request :: (Service -> Service) -> CreateIpamPool -> Request CreateIpamPool
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 CreateIpamPool
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateIpamPool)))
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 IpamPool -> Int -> CreateIpamPoolResponse
CreateIpamPoolResponse'
            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
"ipamPool")
            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 CreateIpamPool where
  hashWithSalt :: Int -> CreateIpamPool -> Int
hashWithSalt Int
_salt CreateIpamPool' {Maybe Bool
Maybe Natural
Maybe [RequestIpamResourceTag]
Maybe [TagSpecification]
Maybe Text
Maybe IpamPoolAwsService
Text
AddressFamily
addressFamily :: AddressFamily
ipamScopeId :: Text
tagSpecifications :: Maybe [TagSpecification]
sourceIpamPoolId :: Maybe Text
publiclyAdvertisable :: Maybe Bool
locale :: Maybe Text
dryRun :: Maybe Bool
description :: Maybe Text
clientToken :: Maybe Text
awsService :: Maybe IpamPoolAwsService
autoImport :: Maybe Bool
allocationResourceTags :: Maybe [RequestIpamResourceTag]
allocationMinNetmaskLength :: Maybe Natural
allocationMaxNetmaskLength :: Maybe Natural
allocationDefaultNetmaskLength :: Maybe Natural
$sel:addressFamily:CreateIpamPool' :: CreateIpamPool -> AddressFamily
$sel:ipamScopeId:CreateIpamPool' :: CreateIpamPool -> Text
$sel:tagSpecifications:CreateIpamPool' :: CreateIpamPool -> Maybe [TagSpecification]
$sel:sourceIpamPoolId:CreateIpamPool' :: CreateIpamPool -> Maybe Text
$sel:publiclyAdvertisable:CreateIpamPool' :: CreateIpamPool -> Maybe Bool
$sel:locale:CreateIpamPool' :: CreateIpamPool -> Maybe Text
$sel:dryRun:CreateIpamPool' :: CreateIpamPool -> Maybe Bool
$sel:description:CreateIpamPool' :: CreateIpamPool -> Maybe Text
$sel:clientToken:CreateIpamPool' :: CreateIpamPool -> Maybe Text
$sel:awsService:CreateIpamPool' :: CreateIpamPool -> Maybe IpamPoolAwsService
$sel:autoImport:CreateIpamPool' :: CreateIpamPool -> Maybe Bool
$sel:allocationResourceTags:CreateIpamPool' :: CreateIpamPool -> Maybe [RequestIpamResourceTag]
$sel:allocationMinNetmaskLength:CreateIpamPool' :: CreateIpamPool -> Maybe Natural
$sel:allocationMaxNetmaskLength:CreateIpamPool' :: CreateIpamPool -> Maybe Natural
$sel:allocationDefaultNetmaskLength:CreateIpamPool' :: CreateIpamPool -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
allocationDefaultNetmaskLength
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
allocationMaxNetmaskLength
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
allocationMinNetmaskLength
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RequestIpamResourceTag]
allocationResourceTags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
autoImport
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IpamPoolAwsService
awsService
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      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 Text
locale
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
publiclyAdvertisable
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceIpamPoolId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TagSpecification]
tagSpecifications
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ipamScopeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AddressFamily
addressFamily

instance Prelude.NFData CreateIpamPool where
  rnf :: CreateIpamPool -> ()
rnf CreateIpamPool' {Maybe Bool
Maybe Natural
Maybe [RequestIpamResourceTag]
Maybe [TagSpecification]
Maybe Text
Maybe IpamPoolAwsService
Text
AddressFamily
addressFamily :: AddressFamily
ipamScopeId :: Text
tagSpecifications :: Maybe [TagSpecification]
sourceIpamPoolId :: Maybe Text
publiclyAdvertisable :: Maybe Bool
locale :: Maybe Text
dryRun :: Maybe Bool
description :: Maybe Text
clientToken :: Maybe Text
awsService :: Maybe IpamPoolAwsService
autoImport :: Maybe Bool
allocationResourceTags :: Maybe [RequestIpamResourceTag]
allocationMinNetmaskLength :: Maybe Natural
allocationMaxNetmaskLength :: Maybe Natural
allocationDefaultNetmaskLength :: Maybe Natural
$sel:addressFamily:CreateIpamPool' :: CreateIpamPool -> AddressFamily
$sel:ipamScopeId:CreateIpamPool' :: CreateIpamPool -> Text
$sel:tagSpecifications:CreateIpamPool' :: CreateIpamPool -> Maybe [TagSpecification]
$sel:sourceIpamPoolId:CreateIpamPool' :: CreateIpamPool -> Maybe Text
$sel:publiclyAdvertisable:CreateIpamPool' :: CreateIpamPool -> Maybe Bool
$sel:locale:CreateIpamPool' :: CreateIpamPool -> Maybe Text
$sel:dryRun:CreateIpamPool' :: CreateIpamPool -> Maybe Bool
$sel:description:CreateIpamPool' :: CreateIpamPool -> Maybe Text
$sel:clientToken:CreateIpamPool' :: CreateIpamPool -> Maybe Text
$sel:awsService:CreateIpamPool' :: CreateIpamPool -> Maybe IpamPoolAwsService
$sel:autoImport:CreateIpamPool' :: CreateIpamPool -> Maybe Bool
$sel:allocationResourceTags:CreateIpamPool' :: CreateIpamPool -> Maybe [RequestIpamResourceTag]
$sel:allocationMinNetmaskLength:CreateIpamPool' :: CreateIpamPool -> Maybe Natural
$sel:allocationMaxNetmaskLength:CreateIpamPool' :: CreateIpamPool -> Maybe Natural
$sel:allocationDefaultNetmaskLength:CreateIpamPool' :: CreateIpamPool -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
allocationDefaultNetmaskLength
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
allocationMaxNetmaskLength
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
allocationMinNetmaskLength
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RequestIpamResourceTag]
allocationResourceTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
autoImport
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IpamPoolAwsService
awsService
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
locale
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
publiclyAdvertisable
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceIpamPoolId
      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
ipamScopeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AddressFamily
addressFamily

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

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

instance Data.ToQuery CreateIpamPool where
  toQuery :: CreateIpamPool -> QueryString
toQuery CreateIpamPool' {Maybe Bool
Maybe Natural
Maybe [RequestIpamResourceTag]
Maybe [TagSpecification]
Maybe Text
Maybe IpamPoolAwsService
Text
AddressFamily
addressFamily :: AddressFamily
ipamScopeId :: Text
tagSpecifications :: Maybe [TagSpecification]
sourceIpamPoolId :: Maybe Text
publiclyAdvertisable :: Maybe Bool
locale :: Maybe Text
dryRun :: Maybe Bool
description :: Maybe Text
clientToken :: Maybe Text
awsService :: Maybe IpamPoolAwsService
autoImport :: Maybe Bool
allocationResourceTags :: Maybe [RequestIpamResourceTag]
allocationMinNetmaskLength :: Maybe Natural
allocationMaxNetmaskLength :: Maybe Natural
allocationDefaultNetmaskLength :: Maybe Natural
$sel:addressFamily:CreateIpamPool' :: CreateIpamPool -> AddressFamily
$sel:ipamScopeId:CreateIpamPool' :: CreateIpamPool -> Text
$sel:tagSpecifications:CreateIpamPool' :: CreateIpamPool -> Maybe [TagSpecification]
$sel:sourceIpamPoolId:CreateIpamPool' :: CreateIpamPool -> Maybe Text
$sel:publiclyAdvertisable:CreateIpamPool' :: CreateIpamPool -> Maybe Bool
$sel:locale:CreateIpamPool' :: CreateIpamPool -> Maybe Text
$sel:dryRun:CreateIpamPool' :: CreateIpamPool -> Maybe Bool
$sel:description:CreateIpamPool' :: CreateIpamPool -> Maybe Text
$sel:clientToken:CreateIpamPool' :: CreateIpamPool -> Maybe Text
$sel:awsService:CreateIpamPool' :: CreateIpamPool -> Maybe IpamPoolAwsService
$sel:autoImport:CreateIpamPool' :: CreateIpamPool -> Maybe Bool
$sel:allocationResourceTags:CreateIpamPool' :: CreateIpamPool -> Maybe [RequestIpamResourceTag]
$sel:allocationMinNetmaskLength:CreateIpamPool' :: CreateIpamPool -> Maybe Natural
$sel:allocationMaxNetmaskLength:CreateIpamPool' :: CreateIpamPool -> Maybe Natural
$sel:allocationDefaultNetmaskLength:CreateIpamPool' :: CreateIpamPool -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateIpamPool" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"AllocationDefaultNetmaskLength"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
allocationDefaultNetmaskLength,
        ByteString
"AllocationMaxNetmaskLength"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
allocationMaxNetmaskLength,
        ByteString
"AllocationMinNetmaskLength"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
allocationMinNetmaskLength,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"AllocationResourceTag"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RequestIpamResourceTag]
allocationResourceTags
          ),
        ByteString
"AutoImport" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
autoImport,
        ByteString
"AwsService" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe IpamPoolAwsService
awsService,
        ByteString
"ClientToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
clientToken,
        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,
        ByteString
"Locale" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
locale,
        ByteString
"PubliclyAdvertisable" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
publiclyAdvertisable,
        ByteString
"SourceIpamPoolId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
sourceIpamPoolId,
        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
"IpamScopeId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
ipamScopeId,
        ByteString
"AddressFamily" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: AddressFamily
addressFamily
      ]

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

-- |
-- Create a value of 'CreateIpamPoolResponse' 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:
--
-- 'ipamPool', 'createIpamPoolResponse_ipamPool' - Information about the IPAM pool created.
--
-- 'httpStatus', 'createIpamPoolResponse_httpStatus' - The response's http status code.
newCreateIpamPoolResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateIpamPoolResponse
newCreateIpamPoolResponse :: Int -> CreateIpamPoolResponse
newCreateIpamPoolResponse Int
pHttpStatus_ =
  CreateIpamPoolResponse'
    { $sel:ipamPool:CreateIpamPoolResponse' :: Maybe IpamPool
ipamPool = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateIpamPoolResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the IPAM pool created.
createIpamPoolResponse_ipamPool :: Lens.Lens' CreateIpamPoolResponse (Prelude.Maybe IpamPool)
createIpamPoolResponse_ipamPool :: Lens' CreateIpamPoolResponse (Maybe IpamPool)
createIpamPoolResponse_ipamPool = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIpamPoolResponse' {Maybe IpamPool
ipamPool :: Maybe IpamPool
$sel:ipamPool:CreateIpamPoolResponse' :: CreateIpamPoolResponse -> Maybe IpamPool
ipamPool} -> Maybe IpamPool
ipamPool) (\s :: CreateIpamPoolResponse
s@CreateIpamPoolResponse' {} Maybe IpamPool
a -> CreateIpamPoolResponse
s {$sel:ipamPool:CreateIpamPoolResponse' :: Maybe IpamPool
ipamPool = Maybe IpamPool
a} :: CreateIpamPoolResponse)

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

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