{-# 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.ModifyIpamPool
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modify the configurations of an IPAM pool.
--
-- For more information, see
-- <https://docs.aws.amazon.com/vpc/latest/ipam/mod-pool-ipam.html Modify a pool>
-- in the /Amazon VPC IPAM User Guide/.
module Amazonka.EC2.ModifyIpamPool
  ( -- * Creating a Request
    ModifyIpamPool (..),
    newModifyIpamPool,

    -- * Request Lenses
    modifyIpamPool_addAllocationResourceTags,
    modifyIpamPool_allocationDefaultNetmaskLength,
    modifyIpamPool_allocationMaxNetmaskLength,
    modifyIpamPool_allocationMinNetmaskLength,
    modifyIpamPool_autoImport,
    modifyIpamPool_clearAllocationDefaultNetmaskLength,
    modifyIpamPool_description,
    modifyIpamPool_dryRun,
    modifyIpamPool_removeAllocationResourceTags,
    modifyIpamPool_ipamPoolId,

    -- * Destructuring the Response
    ModifyIpamPoolResponse (..),
    newModifyIpamPoolResponse,

    -- * Response Lenses
    modifyIpamPoolResponse_ipamPool,
    modifyIpamPoolResponse_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:/ 'newModifyIpamPool' smart constructor.
data ModifyIpamPool = ModifyIpamPool'
  { -- | Add tag allocation rules to a pool. For more information about
    -- allocation rules, 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/.
    ModifyIpamPool -> Maybe [RequestIpamResourceTag]
addAllocationResourceTags :: Prelude.Maybe [RequestIpamResourceTag],
    -- | 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.
    ModifyIpamPool -> Maybe Natural
allocationDefaultNetmaskLength :: Prelude.Maybe Prelude.Natural,
    -- | The maximum netmask length possible for CIDR allocations in this IPAM
    -- pool to be compliant. Possible netmask lengths for IPv4 addresses are 0
    -- - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.The
    -- maximum netmask length must be greater than the minimum netmask length.
    ModifyIpamPool -> Maybe Natural
allocationMaxNetmaskLength :: Prelude.Maybe Prelude.Natural,
    -- | The minimum netmask length required for CIDR allocations in this IPAM
    -- pool to be compliant. Possible netmask lengths for IPv4 addresses are 0
    -- - 32. Possible netmask lengths for IPv6 addresses are 0 - 128. The
    -- minimum netmask length must be less than the maximum netmask length.
    ModifyIpamPool -> Maybe Natural
allocationMinNetmaskLength :: Prelude.Maybe Prelude.Natural,
    -- | If true, 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.
    ModifyIpamPool -> Maybe Bool
autoImport :: Prelude.Maybe Prelude.Bool,
    -- | Clear the default netmask length allocation rule for this pool.
    ModifyIpamPool -> Maybe Bool
clearAllocationDefaultNetmaskLength :: Prelude.Maybe Prelude.Bool,
    -- | The description of the IPAM pool you want to modify.
    ModifyIpamPool -> 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@.
    ModifyIpamPool -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | Remove tag allocation rules from a pool.
    ModifyIpamPool -> Maybe [RequestIpamResourceTag]
removeAllocationResourceTags :: Prelude.Maybe [RequestIpamResourceTag],
    -- | The ID of the IPAM pool you want to modify.
    ModifyIpamPool -> Text
ipamPoolId :: Prelude.Text
  }
  deriving (ModifyIpamPool -> ModifyIpamPool -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyIpamPool -> ModifyIpamPool -> Bool
$c/= :: ModifyIpamPool -> ModifyIpamPool -> Bool
== :: ModifyIpamPool -> ModifyIpamPool -> Bool
$c== :: ModifyIpamPool -> ModifyIpamPool -> Bool
Prelude.Eq, ReadPrec [ModifyIpamPool]
ReadPrec ModifyIpamPool
Int -> ReadS ModifyIpamPool
ReadS [ModifyIpamPool]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyIpamPool]
$creadListPrec :: ReadPrec [ModifyIpamPool]
readPrec :: ReadPrec ModifyIpamPool
$creadPrec :: ReadPrec ModifyIpamPool
readList :: ReadS [ModifyIpamPool]
$creadList :: ReadS [ModifyIpamPool]
readsPrec :: Int -> ReadS ModifyIpamPool
$creadsPrec :: Int -> ReadS ModifyIpamPool
Prelude.Read, Int -> ModifyIpamPool -> ShowS
[ModifyIpamPool] -> ShowS
ModifyIpamPool -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyIpamPool] -> ShowS
$cshowList :: [ModifyIpamPool] -> ShowS
show :: ModifyIpamPool -> String
$cshow :: ModifyIpamPool -> String
showsPrec :: Int -> ModifyIpamPool -> ShowS
$cshowsPrec :: Int -> ModifyIpamPool -> ShowS
Prelude.Show, forall x. Rep ModifyIpamPool x -> ModifyIpamPool
forall x. ModifyIpamPool -> Rep ModifyIpamPool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyIpamPool x -> ModifyIpamPool
$cfrom :: forall x. ModifyIpamPool -> Rep ModifyIpamPool x
Prelude.Generic)

-- |
-- Create a value of 'ModifyIpamPool' 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:
--
-- 'addAllocationResourceTags', 'modifyIpamPool_addAllocationResourceTags' - Add tag allocation rules to a pool. For more information about
-- allocation rules, 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/.
--
-- 'allocationDefaultNetmaskLength', 'modifyIpamPool_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', 'modifyIpamPool_allocationMaxNetmaskLength' - The maximum netmask length possible for CIDR allocations in this IPAM
-- pool to be compliant. Possible netmask lengths for IPv4 addresses are 0
-- - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.The
-- maximum netmask length must be greater than the minimum netmask length.
--
-- 'allocationMinNetmaskLength', 'modifyIpamPool_allocationMinNetmaskLength' - The minimum netmask length required for CIDR allocations in this IPAM
-- pool to be compliant. Possible netmask lengths for IPv4 addresses are 0
-- - 32. Possible netmask lengths for IPv6 addresses are 0 - 128. The
-- minimum netmask length must be less than the maximum netmask length.
--
-- 'autoImport', 'modifyIpamPool_autoImport' - If true, 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.
--
-- 'clearAllocationDefaultNetmaskLength', 'modifyIpamPool_clearAllocationDefaultNetmaskLength' - Clear the default netmask length allocation rule for this pool.
--
-- 'description', 'modifyIpamPool_description' - The description of the IPAM pool you want to modify.
--
-- 'dryRun', 'modifyIpamPool_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@.
--
-- 'removeAllocationResourceTags', 'modifyIpamPool_removeAllocationResourceTags' - Remove tag allocation rules from a pool.
--
-- 'ipamPoolId', 'modifyIpamPool_ipamPoolId' - The ID of the IPAM pool you want to modify.
newModifyIpamPool ::
  -- | 'ipamPoolId'
  Prelude.Text ->
  ModifyIpamPool
newModifyIpamPool :: Text -> ModifyIpamPool
newModifyIpamPool Text
pIpamPoolId_ =
  ModifyIpamPool'
    { $sel:addAllocationResourceTags:ModifyIpamPool' :: Maybe [RequestIpamResourceTag]
addAllocationResourceTags =
        forall a. Maybe a
Prelude.Nothing,
      $sel:allocationDefaultNetmaskLength:ModifyIpamPool' :: Maybe Natural
allocationDefaultNetmaskLength = forall a. Maybe a
Prelude.Nothing,
      $sel:allocationMaxNetmaskLength:ModifyIpamPool' :: Maybe Natural
allocationMaxNetmaskLength = forall a. Maybe a
Prelude.Nothing,
      $sel:allocationMinNetmaskLength:ModifyIpamPool' :: Maybe Natural
allocationMinNetmaskLength = forall a. Maybe a
Prelude.Nothing,
      $sel:autoImport:ModifyIpamPool' :: Maybe Bool
autoImport = forall a. Maybe a
Prelude.Nothing,
      $sel:clearAllocationDefaultNetmaskLength:ModifyIpamPool' :: Maybe Bool
clearAllocationDefaultNetmaskLength =
        forall a. Maybe a
Prelude.Nothing,
      $sel:description:ModifyIpamPool' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:ModifyIpamPool' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:removeAllocationResourceTags:ModifyIpamPool' :: Maybe [RequestIpamResourceTag]
removeAllocationResourceTags = forall a. Maybe a
Prelude.Nothing,
      $sel:ipamPoolId:ModifyIpamPool' :: Text
ipamPoolId = Text
pIpamPoolId_
    }

-- | Add tag allocation rules to a pool. For more information about
-- allocation rules, 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/.
modifyIpamPool_addAllocationResourceTags :: Lens.Lens' ModifyIpamPool (Prelude.Maybe [RequestIpamResourceTag])
modifyIpamPool_addAllocationResourceTags :: Lens' ModifyIpamPool (Maybe [RequestIpamResourceTag])
modifyIpamPool_addAllocationResourceTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyIpamPool' {Maybe [RequestIpamResourceTag]
addAllocationResourceTags :: Maybe [RequestIpamResourceTag]
$sel:addAllocationResourceTags:ModifyIpamPool' :: ModifyIpamPool -> Maybe [RequestIpamResourceTag]
addAllocationResourceTags} -> Maybe [RequestIpamResourceTag]
addAllocationResourceTags) (\s :: ModifyIpamPool
s@ModifyIpamPool' {} Maybe [RequestIpamResourceTag]
a -> ModifyIpamPool
s {$sel:addAllocationResourceTags:ModifyIpamPool' :: Maybe [RequestIpamResourceTag]
addAllocationResourceTags = Maybe [RequestIpamResourceTag]
a} :: ModifyIpamPool) 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 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.
modifyIpamPool_allocationDefaultNetmaskLength :: Lens.Lens' ModifyIpamPool (Prelude.Maybe Prelude.Natural)
modifyIpamPool_allocationDefaultNetmaskLength :: Lens' ModifyIpamPool (Maybe Natural)
modifyIpamPool_allocationDefaultNetmaskLength = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyIpamPool' {Maybe Natural
allocationDefaultNetmaskLength :: Maybe Natural
$sel:allocationDefaultNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Natural
allocationDefaultNetmaskLength} -> Maybe Natural
allocationDefaultNetmaskLength) (\s :: ModifyIpamPool
s@ModifyIpamPool' {} Maybe Natural
a -> ModifyIpamPool
s {$sel:allocationDefaultNetmaskLength:ModifyIpamPool' :: Maybe Natural
allocationDefaultNetmaskLength = Maybe Natural
a} :: ModifyIpamPool)

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

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

-- | If true, 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.
modifyIpamPool_autoImport :: Lens.Lens' ModifyIpamPool (Prelude.Maybe Prelude.Bool)
modifyIpamPool_autoImport :: Lens' ModifyIpamPool (Maybe Bool)
modifyIpamPool_autoImport = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyIpamPool' {Maybe Bool
autoImport :: Maybe Bool
$sel:autoImport:ModifyIpamPool' :: ModifyIpamPool -> Maybe Bool
autoImport} -> Maybe Bool
autoImport) (\s :: ModifyIpamPool
s@ModifyIpamPool' {} Maybe Bool
a -> ModifyIpamPool
s {$sel:autoImport:ModifyIpamPool' :: Maybe Bool
autoImport = Maybe Bool
a} :: ModifyIpamPool)

-- | Clear the default netmask length allocation rule for this pool.
modifyIpamPool_clearAllocationDefaultNetmaskLength :: Lens.Lens' ModifyIpamPool (Prelude.Maybe Prelude.Bool)
modifyIpamPool_clearAllocationDefaultNetmaskLength :: Lens' ModifyIpamPool (Maybe Bool)
modifyIpamPool_clearAllocationDefaultNetmaskLength = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyIpamPool' {Maybe Bool
clearAllocationDefaultNetmaskLength :: Maybe Bool
$sel:clearAllocationDefaultNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Bool
clearAllocationDefaultNetmaskLength} -> Maybe Bool
clearAllocationDefaultNetmaskLength) (\s :: ModifyIpamPool
s@ModifyIpamPool' {} Maybe Bool
a -> ModifyIpamPool
s {$sel:clearAllocationDefaultNetmaskLength:ModifyIpamPool' :: Maybe Bool
clearAllocationDefaultNetmaskLength = Maybe Bool
a} :: ModifyIpamPool)

-- | The description of the IPAM pool you want to modify.
modifyIpamPool_description :: Lens.Lens' ModifyIpamPool (Prelude.Maybe Prelude.Text)
modifyIpamPool_description :: Lens' ModifyIpamPool (Maybe Text)
modifyIpamPool_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyIpamPool' {Maybe Text
description :: Maybe Text
$sel:description:ModifyIpamPool' :: ModifyIpamPool -> Maybe Text
description} -> Maybe Text
description) (\s :: ModifyIpamPool
s@ModifyIpamPool' {} Maybe Text
a -> ModifyIpamPool
s {$sel:description:ModifyIpamPool' :: Maybe Text
description = Maybe Text
a} :: ModifyIpamPool)

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

-- | Remove tag allocation rules from a pool.
modifyIpamPool_removeAllocationResourceTags :: Lens.Lens' ModifyIpamPool (Prelude.Maybe [RequestIpamResourceTag])
modifyIpamPool_removeAllocationResourceTags :: Lens' ModifyIpamPool (Maybe [RequestIpamResourceTag])
modifyIpamPool_removeAllocationResourceTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyIpamPool' {Maybe [RequestIpamResourceTag]
removeAllocationResourceTags :: Maybe [RequestIpamResourceTag]
$sel:removeAllocationResourceTags:ModifyIpamPool' :: ModifyIpamPool -> Maybe [RequestIpamResourceTag]
removeAllocationResourceTags} -> Maybe [RequestIpamResourceTag]
removeAllocationResourceTags) (\s :: ModifyIpamPool
s@ModifyIpamPool' {} Maybe [RequestIpamResourceTag]
a -> ModifyIpamPool
s {$sel:removeAllocationResourceTags:ModifyIpamPool' :: Maybe [RequestIpamResourceTag]
removeAllocationResourceTags = Maybe [RequestIpamResourceTag]
a} :: ModifyIpamPool) 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 IPAM pool you want to modify.
modifyIpamPool_ipamPoolId :: Lens.Lens' ModifyIpamPool Prelude.Text
modifyIpamPool_ipamPoolId :: Lens' ModifyIpamPool Text
modifyIpamPool_ipamPoolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyIpamPool' {Text
ipamPoolId :: Text
$sel:ipamPoolId:ModifyIpamPool' :: ModifyIpamPool -> Text
ipamPoolId} -> Text
ipamPoolId) (\s :: ModifyIpamPool
s@ModifyIpamPool' {} Text
a -> ModifyIpamPool
s {$sel:ipamPoolId:ModifyIpamPool' :: Text
ipamPoolId = Text
a} :: ModifyIpamPool)

instance Core.AWSRequest ModifyIpamPool where
  type
    AWSResponse ModifyIpamPool =
      ModifyIpamPoolResponse
  request :: (Service -> Service) -> ModifyIpamPool -> Request ModifyIpamPool
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 ModifyIpamPool
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ModifyIpamPool)))
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 -> ModifyIpamPoolResponse
ModifyIpamPoolResponse'
            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 ModifyIpamPool where
  hashWithSalt :: Int -> ModifyIpamPool -> Int
hashWithSalt Int
_salt ModifyIpamPool' {Maybe Bool
Maybe Natural
Maybe [RequestIpamResourceTag]
Maybe Text
Text
ipamPoolId :: Text
removeAllocationResourceTags :: Maybe [RequestIpamResourceTag]
dryRun :: Maybe Bool
description :: Maybe Text
clearAllocationDefaultNetmaskLength :: Maybe Bool
autoImport :: Maybe Bool
allocationMinNetmaskLength :: Maybe Natural
allocationMaxNetmaskLength :: Maybe Natural
allocationDefaultNetmaskLength :: Maybe Natural
addAllocationResourceTags :: Maybe [RequestIpamResourceTag]
$sel:ipamPoolId:ModifyIpamPool' :: ModifyIpamPool -> Text
$sel:removeAllocationResourceTags:ModifyIpamPool' :: ModifyIpamPool -> Maybe [RequestIpamResourceTag]
$sel:dryRun:ModifyIpamPool' :: ModifyIpamPool -> Maybe Bool
$sel:description:ModifyIpamPool' :: ModifyIpamPool -> Maybe Text
$sel:clearAllocationDefaultNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Bool
$sel:autoImport:ModifyIpamPool' :: ModifyIpamPool -> Maybe Bool
$sel:allocationMinNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Natural
$sel:allocationMaxNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Natural
$sel:allocationDefaultNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Natural
$sel:addAllocationResourceTags:ModifyIpamPool' :: ModifyIpamPool -> Maybe [RequestIpamResourceTag]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RequestIpamResourceTag]
addAllocationResourceTags
      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 Bool
autoImport
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
clearAllocationDefaultNetmaskLength
      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 [RequestIpamResourceTag]
removeAllocationResourceTags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ipamPoolId

instance Prelude.NFData ModifyIpamPool where
  rnf :: ModifyIpamPool -> ()
rnf ModifyIpamPool' {Maybe Bool
Maybe Natural
Maybe [RequestIpamResourceTag]
Maybe Text
Text
ipamPoolId :: Text
removeAllocationResourceTags :: Maybe [RequestIpamResourceTag]
dryRun :: Maybe Bool
description :: Maybe Text
clearAllocationDefaultNetmaskLength :: Maybe Bool
autoImport :: Maybe Bool
allocationMinNetmaskLength :: Maybe Natural
allocationMaxNetmaskLength :: Maybe Natural
allocationDefaultNetmaskLength :: Maybe Natural
addAllocationResourceTags :: Maybe [RequestIpamResourceTag]
$sel:ipamPoolId:ModifyIpamPool' :: ModifyIpamPool -> Text
$sel:removeAllocationResourceTags:ModifyIpamPool' :: ModifyIpamPool -> Maybe [RequestIpamResourceTag]
$sel:dryRun:ModifyIpamPool' :: ModifyIpamPool -> Maybe Bool
$sel:description:ModifyIpamPool' :: ModifyIpamPool -> Maybe Text
$sel:clearAllocationDefaultNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Bool
$sel:autoImport:ModifyIpamPool' :: ModifyIpamPool -> Maybe Bool
$sel:allocationMinNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Natural
$sel:allocationMaxNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Natural
$sel:allocationDefaultNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Natural
$sel:addAllocationResourceTags:ModifyIpamPool' :: ModifyIpamPool -> Maybe [RequestIpamResourceTag]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [RequestIpamResourceTag]
addAllocationResourceTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Bool
autoImport
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
clearAllocationDefaultNetmaskLength
      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 [RequestIpamResourceTag]
removeAllocationResourceTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ipamPoolId

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

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

instance Data.ToQuery ModifyIpamPool where
  toQuery :: ModifyIpamPool -> QueryString
toQuery ModifyIpamPool' {Maybe Bool
Maybe Natural
Maybe [RequestIpamResourceTag]
Maybe Text
Text
ipamPoolId :: Text
removeAllocationResourceTags :: Maybe [RequestIpamResourceTag]
dryRun :: Maybe Bool
description :: Maybe Text
clearAllocationDefaultNetmaskLength :: Maybe Bool
autoImport :: Maybe Bool
allocationMinNetmaskLength :: Maybe Natural
allocationMaxNetmaskLength :: Maybe Natural
allocationDefaultNetmaskLength :: Maybe Natural
addAllocationResourceTags :: Maybe [RequestIpamResourceTag]
$sel:ipamPoolId:ModifyIpamPool' :: ModifyIpamPool -> Text
$sel:removeAllocationResourceTags:ModifyIpamPool' :: ModifyIpamPool -> Maybe [RequestIpamResourceTag]
$sel:dryRun:ModifyIpamPool' :: ModifyIpamPool -> Maybe Bool
$sel:description:ModifyIpamPool' :: ModifyIpamPool -> Maybe Text
$sel:clearAllocationDefaultNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Bool
$sel:autoImport:ModifyIpamPool' :: ModifyIpamPool -> Maybe Bool
$sel:allocationMinNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Natural
$sel:allocationMaxNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Natural
$sel:allocationDefaultNetmaskLength:ModifyIpamPool' :: ModifyIpamPool -> Maybe Natural
$sel:addAllocationResourceTags:ModifyIpamPool' :: ModifyIpamPool -> Maybe [RequestIpamResourceTag]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ModifyIpamPool" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"AddAllocationResourceTag"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RequestIpamResourceTag]
addAllocationResourceTags
          ),
        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,
        ByteString
"AutoImport" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
autoImport,
        ByteString
"ClearAllocationDefaultNetmaskLength"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
clearAllocationDefaultNetmaskLength,
        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
"RemoveAllocationResourceTag"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RequestIpamResourceTag]
removeAllocationResourceTags
          ),
        ByteString
"IpamPoolId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
ipamPoolId
      ]

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

-- |
-- Create a value of 'ModifyIpamPoolResponse' 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', 'modifyIpamPoolResponse_ipamPool' - The results of the modification.
--
-- 'httpStatus', 'modifyIpamPoolResponse_httpStatus' - The response's http status code.
newModifyIpamPoolResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyIpamPoolResponse
newModifyIpamPoolResponse :: Int -> ModifyIpamPoolResponse
newModifyIpamPoolResponse Int
pHttpStatus_ =
  ModifyIpamPoolResponse'
    { $sel:ipamPool:ModifyIpamPoolResponse' :: Maybe IpamPool
ipamPool = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ModifyIpamPoolResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The results of the modification.
modifyIpamPoolResponse_ipamPool :: Lens.Lens' ModifyIpamPoolResponse (Prelude.Maybe IpamPool)
modifyIpamPoolResponse_ipamPool :: Lens' ModifyIpamPoolResponse (Maybe IpamPool)
modifyIpamPoolResponse_ipamPool = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyIpamPoolResponse' {Maybe IpamPool
ipamPool :: Maybe IpamPool
$sel:ipamPool:ModifyIpamPoolResponse' :: ModifyIpamPoolResponse -> Maybe IpamPool
ipamPool} -> Maybe IpamPool
ipamPool) (\s :: ModifyIpamPoolResponse
s@ModifyIpamPoolResponse' {} Maybe IpamPool
a -> ModifyIpamPoolResponse
s {$sel:ipamPool:ModifyIpamPoolResponse' :: Maybe IpamPool
ipamPool = Maybe IpamPool
a} :: ModifyIpamPoolResponse)

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

instance Prelude.NFData ModifyIpamPoolResponse where
  rnf :: ModifyIpamPoolResponse -> ()
rnf ModifyIpamPoolResponse' {Int
Maybe IpamPool
httpStatus :: Int
ipamPool :: Maybe IpamPool
$sel:httpStatus:ModifyIpamPoolResponse' :: ModifyIpamPoolResponse -> Int
$sel:ipamPool:ModifyIpamPoolResponse' :: ModifyIpamPoolResponse -> 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