{-# 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.NetworkFirewall.DisassociateSubnets
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Removes the specified subnet associations from the firewall. This
-- removes the firewall endpoints from the subnets and removes any network
-- filtering protections that the endpoints were providing.
module Amazonka.NetworkFirewall.DisassociateSubnets
  ( -- * Creating a Request
    DisassociateSubnets (..),
    newDisassociateSubnets,

    -- * Request Lenses
    disassociateSubnets_updateToken,
    disassociateSubnets_firewallArn,
    disassociateSubnets_firewallName,
    disassociateSubnets_subnetIds,

    -- * Destructuring the Response
    DisassociateSubnetsResponse (..),
    newDisassociateSubnetsResponse,

    -- * Response Lenses
    disassociateSubnetsResponse_subnetMappings,
    disassociateSubnetsResponse_updateToken,
    disassociateSubnetsResponse_firewallArn,
    disassociateSubnetsResponse_firewallName,
    disassociateSubnetsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDisassociateSubnets' smart constructor.
data DisassociateSubnets = DisassociateSubnets'
  { -- | An optional token that you can use for optimistic locking. Network
    -- Firewall returns a token to your requests that access the firewall. The
    -- token marks the state of the firewall resource at the time of the
    -- request.
    --
    -- To make an unconditional change to the firewall, omit the token in your
    -- update request. Without the token, Network Firewall performs your
    -- updates regardless of whether the firewall has changed since you last
    -- retrieved it.
    --
    -- To make a conditional change to the firewall, provide the token in your
    -- update request. Network Firewall uses the token to ensure that the
    -- firewall hasn\'t changed since you last retrieved it. If it has changed,
    -- the operation fails with an @InvalidTokenException@. If this happens,
    -- retrieve the firewall again to get a current copy of it with a new
    -- token. Reapply your changes as needed, then try the operation again
    -- using the new token.
    DisassociateSubnets -> Maybe Text
updateToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the firewall.
    --
    -- You must specify the ARN or the name, and you can specify both.
    DisassociateSubnets -> Maybe Text
firewallArn :: Prelude.Maybe Prelude.Text,
    -- | The descriptive name of the firewall. You can\'t change the name of a
    -- firewall after you create it.
    --
    -- You must specify the ARN or the name, and you can specify both.
    DisassociateSubnets -> Maybe Text
firewallName :: Prelude.Maybe Prelude.Text,
    -- | The unique identifiers for the subnets that you want to disassociate.
    DisassociateSubnets -> [Text]
subnetIds :: [Prelude.Text]
  }
  deriving (DisassociateSubnets -> DisassociateSubnets -> Bool
(DisassociateSubnets -> DisassociateSubnets -> Bool)
-> (DisassociateSubnets -> DisassociateSubnets -> Bool)
-> Eq DisassociateSubnets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateSubnets -> DisassociateSubnets -> Bool
$c/= :: DisassociateSubnets -> DisassociateSubnets -> Bool
== :: DisassociateSubnets -> DisassociateSubnets -> Bool
$c== :: DisassociateSubnets -> DisassociateSubnets -> Bool
Prelude.Eq, ReadPrec [DisassociateSubnets]
ReadPrec DisassociateSubnets
Int -> ReadS DisassociateSubnets
ReadS [DisassociateSubnets]
(Int -> ReadS DisassociateSubnets)
-> ReadS [DisassociateSubnets]
-> ReadPrec DisassociateSubnets
-> ReadPrec [DisassociateSubnets]
-> Read DisassociateSubnets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateSubnets]
$creadListPrec :: ReadPrec [DisassociateSubnets]
readPrec :: ReadPrec DisassociateSubnets
$creadPrec :: ReadPrec DisassociateSubnets
readList :: ReadS [DisassociateSubnets]
$creadList :: ReadS [DisassociateSubnets]
readsPrec :: Int -> ReadS DisassociateSubnets
$creadsPrec :: Int -> ReadS DisassociateSubnets
Prelude.Read, Int -> DisassociateSubnets -> ShowS
[DisassociateSubnets] -> ShowS
DisassociateSubnets -> String
(Int -> DisassociateSubnets -> ShowS)
-> (DisassociateSubnets -> String)
-> ([DisassociateSubnets] -> ShowS)
-> Show DisassociateSubnets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateSubnets] -> ShowS
$cshowList :: [DisassociateSubnets] -> ShowS
show :: DisassociateSubnets -> String
$cshow :: DisassociateSubnets -> String
showsPrec :: Int -> DisassociateSubnets -> ShowS
$cshowsPrec :: Int -> DisassociateSubnets -> ShowS
Prelude.Show, (forall x. DisassociateSubnets -> Rep DisassociateSubnets x)
-> (forall x. Rep DisassociateSubnets x -> DisassociateSubnets)
-> Generic DisassociateSubnets
forall x. Rep DisassociateSubnets x -> DisassociateSubnets
forall x. DisassociateSubnets -> Rep DisassociateSubnets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisassociateSubnets x -> DisassociateSubnets
$cfrom :: forall x. DisassociateSubnets -> Rep DisassociateSubnets x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateSubnets' 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:
--
-- 'updateToken', 'disassociateSubnets_updateToken' - An optional token that you can use for optimistic locking. Network
-- Firewall returns a token to your requests that access the firewall. The
-- token marks the state of the firewall resource at the time of the
-- request.
--
-- To make an unconditional change to the firewall, omit the token in your
-- update request. Without the token, Network Firewall performs your
-- updates regardless of whether the firewall has changed since you last
-- retrieved it.
--
-- To make a conditional change to the firewall, provide the token in your
-- update request. Network Firewall uses the token to ensure that the
-- firewall hasn\'t changed since you last retrieved it. If it has changed,
-- the operation fails with an @InvalidTokenException@. If this happens,
-- retrieve the firewall again to get a current copy of it with a new
-- token. Reapply your changes as needed, then try the operation again
-- using the new token.
--
-- 'firewallArn', 'disassociateSubnets_firewallArn' - The Amazon Resource Name (ARN) of the firewall.
--
-- You must specify the ARN or the name, and you can specify both.
--
-- 'firewallName', 'disassociateSubnets_firewallName' - The descriptive name of the firewall. You can\'t change the name of a
-- firewall after you create it.
--
-- You must specify the ARN or the name, and you can specify both.
--
-- 'subnetIds', 'disassociateSubnets_subnetIds' - The unique identifiers for the subnets that you want to disassociate.
newDisassociateSubnets ::
  DisassociateSubnets
newDisassociateSubnets :: DisassociateSubnets
newDisassociateSubnets =
  DisassociateSubnets' :: Maybe Text
-> Maybe Text -> Maybe Text -> [Text] -> DisassociateSubnets
DisassociateSubnets'
    { $sel:updateToken:DisassociateSubnets' :: Maybe Text
updateToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firewallArn:DisassociateSubnets' :: Maybe Text
firewallArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firewallName:DisassociateSubnets' :: Maybe Text
firewallName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:subnetIds:DisassociateSubnets' :: [Text]
subnetIds = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | An optional token that you can use for optimistic locking. Network
-- Firewall returns a token to your requests that access the firewall. The
-- token marks the state of the firewall resource at the time of the
-- request.
--
-- To make an unconditional change to the firewall, omit the token in your
-- update request. Without the token, Network Firewall performs your
-- updates regardless of whether the firewall has changed since you last
-- retrieved it.
--
-- To make a conditional change to the firewall, provide the token in your
-- update request. Network Firewall uses the token to ensure that the
-- firewall hasn\'t changed since you last retrieved it. If it has changed,
-- the operation fails with an @InvalidTokenException@. If this happens,
-- retrieve the firewall again to get a current copy of it with a new
-- token. Reapply your changes as needed, then try the operation again
-- using the new token.
disassociateSubnets_updateToken :: Lens.Lens' DisassociateSubnets (Prelude.Maybe Prelude.Text)
disassociateSubnets_updateToken :: (Maybe Text -> f (Maybe Text))
-> DisassociateSubnets -> f DisassociateSubnets
disassociateSubnets_updateToken = (DisassociateSubnets -> Maybe Text)
-> (DisassociateSubnets -> Maybe Text -> DisassociateSubnets)
-> Lens
     DisassociateSubnets DisassociateSubnets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSubnets' {Maybe Text
updateToken :: Maybe Text
$sel:updateToken:DisassociateSubnets' :: DisassociateSubnets -> Maybe Text
updateToken} -> Maybe Text
updateToken) (\s :: DisassociateSubnets
s@DisassociateSubnets' {} Maybe Text
a -> DisassociateSubnets
s {$sel:updateToken:DisassociateSubnets' :: Maybe Text
updateToken = Maybe Text
a} :: DisassociateSubnets)

-- | The Amazon Resource Name (ARN) of the firewall.
--
-- You must specify the ARN or the name, and you can specify both.
disassociateSubnets_firewallArn :: Lens.Lens' DisassociateSubnets (Prelude.Maybe Prelude.Text)
disassociateSubnets_firewallArn :: (Maybe Text -> f (Maybe Text))
-> DisassociateSubnets -> f DisassociateSubnets
disassociateSubnets_firewallArn = (DisassociateSubnets -> Maybe Text)
-> (DisassociateSubnets -> Maybe Text -> DisassociateSubnets)
-> Lens
     DisassociateSubnets DisassociateSubnets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSubnets' {Maybe Text
firewallArn :: Maybe Text
$sel:firewallArn:DisassociateSubnets' :: DisassociateSubnets -> Maybe Text
firewallArn} -> Maybe Text
firewallArn) (\s :: DisassociateSubnets
s@DisassociateSubnets' {} Maybe Text
a -> DisassociateSubnets
s {$sel:firewallArn:DisassociateSubnets' :: Maybe Text
firewallArn = Maybe Text
a} :: DisassociateSubnets)

-- | The descriptive name of the firewall. You can\'t change the name of a
-- firewall after you create it.
--
-- You must specify the ARN or the name, and you can specify both.
disassociateSubnets_firewallName :: Lens.Lens' DisassociateSubnets (Prelude.Maybe Prelude.Text)
disassociateSubnets_firewallName :: (Maybe Text -> f (Maybe Text))
-> DisassociateSubnets -> f DisassociateSubnets
disassociateSubnets_firewallName = (DisassociateSubnets -> Maybe Text)
-> (DisassociateSubnets -> Maybe Text -> DisassociateSubnets)
-> Lens
     DisassociateSubnets DisassociateSubnets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSubnets' {Maybe Text
firewallName :: Maybe Text
$sel:firewallName:DisassociateSubnets' :: DisassociateSubnets -> Maybe Text
firewallName} -> Maybe Text
firewallName) (\s :: DisassociateSubnets
s@DisassociateSubnets' {} Maybe Text
a -> DisassociateSubnets
s {$sel:firewallName:DisassociateSubnets' :: Maybe Text
firewallName = Maybe Text
a} :: DisassociateSubnets)

-- | The unique identifiers for the subnets that you want to disassociate.
disassociateSubnets_subnetIds :: Lens.Lens' DisassociateSubnets [Prelude.Text]
disassociateSubnets_subnetIds :: ([Text] -> f [Text])
-> DisassociateSubnets -> f DisassociateSubnets
disassociateSubnets_subnetIds = (DisassociateSubnets -> [Text])
-> (DisassociateSubnets -> [Text] -> DisassociateSubnets)
-> Lens DisassociateSubnets DisassociateSubnets [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSubnets' {[Text]
subnetIds :: [Text]
$sel:subnetIds:DisassociateSubnets' :: DisassociateSubnets -> [Text]
subnetIds} -> [Text]
subnetIds) (\s :: DisassociateSubnets
s@DisassociateSubnets' {} [Text]
a -> DisassociateSubnets
s {$sel:subnetIds:DisassociateSubnets' :: [Text]
subnetIds = [Text]
a} :: DisassociateSubnets) (([Text] -> f [Text])
 -> DisassociateSubnets -> f DisassociateSubnets)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DisassociateSubnets
-> f DisassociateSubnets
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest DisassociateSubnets where
  type
    AWSResponse DisassociateSubnets =
      DisassociateSubnetsResponse
  request :: DisassociateSubnets -> Request DisassociateSubnets
request = Service -> DisassociateSubnets -> Request DisassociateSubnets
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DisassociateSubnets
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DisassociateSubnets)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DisassociateSubnets))
-> Logger
-> Service
-> Proxy DisassociateSubnets
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DisassociateSubnets)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [SubnetMapping]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> DisassociateSubnetsResponse
DisassociateSubnetsResponse'
            (Maybe [SubnetMapping]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> DisassociateSubnetsResponse)
-> Either String (Maybe [SubnetMapping])
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Int -> DisassociateSubnetsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [SubnetMapping]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SubnetMappings" Either String (Maybe (Maybe [SubnetMapping]))
-> Maybe [SubnetMapping] -> Either String (Maybe [SubnetMapping])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SubnetMapping]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Int -> DisassociateSubnetsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> DisassociateSubnetsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UpdateToken")
            Either
  String
  (Maybe Text -> Maybe Text -> Int -> DisassociateSubnetsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> DisassociateSubnetsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FirewallArn")
            Either String (Maybe Text -> Int -> DisassociateSubnetsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DisassociateSubnetsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FirewallName")
            Either String (Int -> DisassociateSubnetsResponse)
-> Either String Int -> Either String DisassociateSubnetsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DisassociateSubnets

instance Prelude.NFData DisassociateSubnets

instance Core.ToHeaders DisassociateSubnets where
  toHeaders :: DisassociateSubnets -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DisassociateSubnets -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"NetworkFirewall_20201112.DisassociateSubnets" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DisassociateSubnets where
  toJSON :: DisassociateSubnets -> Value
toJSON DisassociateSubnets' {[Text]
Maybe Text
subnetIds :: [Text]
firewallName :: Maybe Text
firewallArn :: Maybe Text
updateToken :: Maybe Text
$sel:subnetIds:DisassociateSubnets' :: DisassociateSubnets -> [Text]
$sel:firewallName:DisassociateSubnets' :: DisassociateSubnets -> Maybe Text
$sel:firewallArn:DisassociateSubnets' :: DisassociateSubnets -> Maybe Text
$sel:updateToken:DisassociateSubnets' :: DisassociateSubnets -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"UpdateToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
updateToken,
            (Text
"FirewallArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
firewallArn,
            (Text
"FirewallName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
firewallName,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SubnetIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
subnetIds)
          ]
      )

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

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

-- | /See:/ 'newDisassociateSubnetsResponse' smart constructor.
data DisassociateSubnetsResponse = DisassociateSubnetsResponse'
  { -- | The IDs of the subnets that are associated with the firewall.
    DisassociateSubnetsResponse -> Maybe [SubnetMapping]
subnetMappings :: Prelude.Maybe [SubnetMapping],
    -- | An optional token that you can use for optimistic locking. Network
    -- Firewall returns a token to your requests that access the firewall. The
    -- token marks the state of the firewall resource at the time of the
    -- request.
    --
    -- To make an unconditional change to the firewall, omit the token in your
    -- update request. Without the token, Network Firewall performs your
    -- updates regardless of whether the firewall has changed since you last
    -- retrieved it.
    --
    -- To make a conditional change to the firewall, provide the token in your
    -- update request. Network Firewall uses the token to ensure that the
    -- firewall hasn\'t changed since you last retrieved it. If it has changed,
    -- the operation fails with an @InvalidTokenException@. If this happens,
    -- retrieve the firewall again to get a current copy of it with a new
    -- token. Reapply your changes as needed, then try the operation again
    -- using the new token.
    DisassociateSubnetsResponse -> Maybe Text
updateToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the firewall.
    DisassociateSubnetsResponse -> Maybe Text
firewallArn :: Prelude.Maybe Prelude.Text,
    -- | The descriptive name of the firewall. You can\'t change the name of a
    -- firewall after you create it.
    DisassociateSubnetsResponse -> Maybe Text
firewallName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DisassociateSubnetsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DisassociateSubnetsResponse -> DisassociateSubnetsResponse -> Bool
(DisassociateSubnetsResponse
 -> DisassociateSubnetsResponse -> Bool)
-> (DisassociateSubnetsResponse
    -> DisassociateSubnetsResponse -> Bool)
-> Eq DisassociateSubnetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateSubnetsResponse -> DisassociateSubnetsResponse -> Bool
$c/= :: DisassociateSubnetsResponse -> DisassociateSubnetsResponse -> Bool
== :: DisassociateSubnetsResponse -> DisassociateSubnetsResponse -> Bool
$c== :: DisassociateSubnetsResponse -> DisassociateSubnetsResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateSubnetsResponse]
ReadPrec DisassociateSubnetsResponse
Int -> ReadS DisassociateSubnetsResponse
ReadS [DisassociateSubnetsResponse]
(Int -> ReadS DisassociateSubnetsResponse)
-> ReadS [DisassociateSubnetsResponse]
-> ReadPrec DisassociateSubnetsResponse
-> ReadPrec [DisassociateSubnetsResponse]
-> Read DisassociateSubnetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateSubnetsResponse]
$creadListPrec :: ReadPrec [DisassociateSubnetsResponse]
readPrec :: ReadPrec DisassociateSubnetsResponse
$creadPrec :: ReadPrec DisassociateSubnetsResponse
readList :: ReadS [DisassociateSubnetsResponse]
$creadList :: ReadS [DisassociateSubnetsResponse]
readsPrec :: Int -> ReadS DisassociateSubnetsResponse
$creadsPrec :: Int -> ReadS DisassociateSubnetsResponse
Prelude.Read, Int -> DisassociateSubnetsResponse -> ShowS
[DisassociateSubnetsResponse] -> ShowS
DisassociateSubnetsResponse -> String
(Int -> DisassociateSubnetsResponse -> ShowS)
-> (DisassociateSubnetsResponse -> String)
-> ([DisassociateSubnetsResponse] -> ShowS)
-> Show DisassociateSubnetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateSubnetsResponse] -> ShowS
$cshowList :: [DisassociateSubnetsResponse] -> ShowS
show :: DisassociateSubnetsResponse -> String
$cshow :: DisassociateSubnetsResponse -> String
showsPrec :: Int -> DisassociateSubnetsResponse -> ShowS
$cshowsPrec :: Int -> DisassociateSubnetsResponse -> ShowS
Prelude.Show, (forall x.
 DisassociateSubnetsResponse -> Rep DisassociateSubnetsResponse x)
-> (forall x.
    Rep DisassociateSubnetsResponse x -> DisassociateSubnetsResponse)
-> Generic DisassociateSubnetsResponse
forall x.
Rep DisassociateSubnetsResponse x -> DisassociateSubnetsResponse
forall x.
DisassociateSubnetsResponse -> Rep DisassociateSubnetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateSubnetsResponse x -> DisassociateSubnetsResponse
$cfrom :: forall x.
DisassociateSubnetsResponse -> Rep DisassociateSubnetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateSubnetsResponse' 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:
--
-- 'subnetMappings', 'disassociateSubnetsResponse_subnetMappings' - The IDs of the subnets that are associated with the firewall.
--
-- 'updateToken', 'disassociateSubnetsResponse_updateToken' - An optional token that you can use for optimistic locking. Network
-- Firewall returns a token to your requests that access the firewall. The
-- token marks the state of the firewall resource at the time of the
-- request.
--
-- To make an unconditional change to the firewall, omit the token in your
-- update request. Without the token, Network Firewall performs your
-- updates regardless of whether the firewall has changed since you last
-- retrieved it.
--
-- To make a conditional change to the firewall, provide the token in your
-- update request. Network Firewall uses the token to ensure that the
-- firewall hasn\'t changed since you last retrieved it. If it has changed,
-- the operation fails with an @InvalidTokenException@. If this happens,
-- retrieve the firewall again to get a current copy of it with a new
-- token. Reapply your changes as needed, then try the operation again
-- using the new token.
--
-- 'firewallArn', 'disassociateSubnetsResponse_firewallArn' - The Amazon Resource Name (ARN) of the firewall.
--
-- 'firewallName', 'disassociateSubnetsResponse_firewallName' - The descriptive name of the firewall. You can\'t change the name of a
-- firewall after you create it.
--
-- 'httpStatus', 'disassociateSubnetsResponse_httpStatus' - The response's http status code.
newDisassociateSubnetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DisassociateSubnetsResponse
newDisassociateSubnetsResponse :: Int -> DisassociateSubnetsResponse
newDisassociateSubnetsResponse Int
pHttpStatus_ =
  DisassociateSubnetsResponse' :: Maybe [SubnetMapping]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> DisassociateSubnetsResponse
DisassociateSubnetsResponse'
    { $sel:subnetMappings:DisassociateSubnetsResponse' :: Maybe [SubnetMapping]
subnetMappings =
        Maybe [SubnetMapping]
forall a. Maybe a
Prelude.Nothing,
      $sel:updateToken:DisassociateSubnetsResponse' :: Maybe Text
updateToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firewallArn:DisassociateSubnetsResponse' :: Maybe Text
firewallArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firewallName:DisassociateSubnetsResponse' :: Maybe Text
firewallName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DisassociateSubnetsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The IDs of the subnets that are associated with the firewall.
disassociateSubnetsResponse_subnetMappings :: Lens.Lens' DisassociateSubnetsResponse (Prelude.Maybe [SubnetMapping])
disassociateSubnetsResponse_subnetMappings :: (Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
-> DisassociateSubnetsResponse -> f DisassociateSubnetsResponse
disassociateSubnetsResponse_subnetMappings = (DisassociateSubnetsResponse -> Maybe [SubnetMapping])
-> (DisassociateSubnetsResponse
    -> Maybe [SubnetMapping] -> DisassociateSubnetsResponse)
-> Lens
     DisassociateSubnetsResponse
     DisassociateSubnetsResponse
     (Maybe [SubnetMapping])
     (Maybe [SubnetMapping])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSubnetsResponse' {Maybe [SubnetMapping]
subnetMappings :: Maybe [SubnetMapping]
$sel:subnetMappings:DisassociateSubnetsResponse' :: DisassociateSubnetsResponse -> Maybe [SubnetMapping]
subnetMappings} -> Maybe [SubnetMapping]
subnetMappings) (\s :: DisassociateSubnetsResponse
s@DisassociateSubnetsResponse' {} Maybe [SubnetMapping]
a -> DisassociateSubnetsResponse
s {$sel:subnetMappings:DisassociateSubnetsResponse' :: Maybe [SubnetMapping]
subnetMappings = Maybe [SubnetMapping]
a} :: DisassociateSubnetsResponse) ((Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
 -> DisassociateSubnetsResponse -> f DisassociateSubnetsResponse)
-> ((Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
    -> Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
-> (Maybe [SubnetMapping] -> f (Maybe [SubnetMapping]))
-> DisassociateSubnetsResponse
-> f DisassociateSubnetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SubnetMapping] [SubnetMapping] [SubnetMapping] [SubnetMapping]
-> Iso
     (Maybe [SubnetMapping])
     (Maybe [SubnetMapping])
     (Maybe [SubnetMapping])
     (Maybe [SubnetMapping])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [SubnetMapping] [SubnetMapping] [SubnetMapping] [SubnetMapping]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional token that you can use for optimistic locking. Network
-- Firewall returns a token to your requests that access the firewall. The
-- token marks the state of the firewall resource at the time of the
-- request.
--
-- To make an unconditional change to the firewall, omit the token in your
-- update request. Without the token, Network Firewall performs your
-- updates regardless of whether the firewall has changed since you last
-- retrieved it.
--
-- To make a conditional change to the firewall, provide the token in your
-- update request. Network Firewall uses the token to ensure that the
-- firewall hasn\'t changed since you last retrieved it. If it has changed,
-- the operation fails with an @InvalidTokenException@. If this happens,
-- retrieve the firewall again to get a current copy of it with a new
-- token. Reapply your changes as needed, then try the operation again
-- using the new token.
disassociateSubnetsResponse_updateToken :: Lens.Lens' DisassociateSubnetsResponse (Prelude.Maybe Prelude.Text)
disassociateSubnetsResponse_updateToken :: (Maybe Text -> f (Maybe Text))
-> DisassociateSubnetsResponse -> f DisassociateSubnetsResponse
disassociateSubnetsResponse_updateToken = (DisassociateSubnetsResponse -> Maybe Text)
-> (DisassociateSubnetsResponse
    -> Maybe Text -> DisassociateSubnetsResponse)
-> Lens
     DisassociateSubnetsResponse
     DisassociateSubnetsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSubnetsResponse' {Maybe Text
updateToken :: Maybe Text
$sel:updateToken:DisassociateSubnetsResponse' :: DisassociateSubnetsResponse -> Maybe Text
updateToken} -> Maybe Text
updateToken) (\s :: DisassociateSubnetsResponse
s@DisassociateSubnetsResponse' {} Maybe Text
a -> DisassociateSubnetsResponse
s {$sel:updateToken:DisassociateSubnetsResponse' :: Maybe Text
updateToken = Maybe Text
a} :: DisassociateSubnetsResponse)

-- | The Amazon Resource Name (ARN) of the firewall.
disassociateSubnetsResponse_firewallArn :: Lens.Lens' DisassociateSubnetsResponse (Prelude.Maybe Prelude.Text)
disassociateSubnetsResponse_firewallArn :: (Maybe Text -> f (Maybe Text))
-> DisassociateSubnetsResponse -> f DisassociateSubnetsResponse
disassociateSubnetsResponse_firewallArn = (DisassociateSubnetsResponse -> Maybe Text)
-> (DisassociateSubnetsResponse
    -> Maybe Text -> DisassociateSubnetsResponse)
-> Lens
     DisassociateSubnetsResponse
     DisassociateSubnetsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSubnetsResponse' {Maybe Text
firewallArn :: Maybe Text
$sel:firewallArn:DisassociateSubnetsResponse' :: DisassociateSubnetsResponse -> Maybe Text
firewallArn} -> Maybe Text
firewallArn) (\s :: DisassociateSubnetsResponse
s@DisassociateSubnetsResponse' {} Maybe Text
a -> DisassociateSubnetsResponse
s {$sel:firewallArn:DisassociateSubnetsResponse' :: Maybe Text
firewallArn = Maybe Text
a} :: DisassociateSubnetsResponse)

-- | The descriptive name of the firewall. You can\'t change the name of a
-- firewall after you create it.
disassociateSubnetsResponse_firewallName :: Lens.Lens' DisassociateSubnetsResponse (Prelude.Maybe Prelude.Text)
disassociateSubnetsResponse_firewallName :: (Maybe Text -> f (Maybe Text))
-> DisassociateSubnetsResponse -> f DisassociateSubnetsResponse
disassociateSubnetsResponse_firewallName = (DisassociateSubnetsResponse -> Maybe Text)
-> (DisassociateSubnetsResponse
    -> Maybe Text -> DisassociateSubnetsResponse)
-> Lens
     DisassociateSubnetsResponse
     DisassociateSubnetsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSubnetsResponse' {Maybe Text
firewallName :: Maybe Text
$sel:firewallName:DisassociateSubnetsResponse' :: DisassociateSubnetsResponse -> Maybe Text
firewallName} -> Maybe Text
firewallName) (\s :: DisassociateSubnetsResponse
s@DisassociateSubnetsResponse' {} Maybe Text
a -> DisassociateSubnetsResponse
s {$sel:firewallName:DisassociateSubnetsResponse' :: Maybe Text
firewallName = Maybe Text
a} :: DisassociateSubnetsResponse)

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

instance Prelude.NFData DisassociateSubnetsResponse