{-# 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 #-}
module Amazonka.NetworkFirewall.DeleteFirewall
(
DeleteFirewall (..),
newDeleteFirewall,
deleteFirewall_firewallArn,
deleteFirewall_firewallName,
DeleteFirewallResponse (..),
newDeleteFirewallResponse,
deleteFirewallResponse_firewallStatus,
deleteFirewallResponse_firewall,
deleteFirewallResponse_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
data DeleteFirewall = DeleteFirewall'
{
DeleteFirewall -> Maybe Text
firewallArn :: Prelude.Maybe Prelude.Text,
DeleteFirewall -> Maybe Text
firewallName :: Prelude.Maybe Prelude.Text
}
deriving (DeleteFirewall -> DeleteFirewall -> Bool
(DeleteFirewall -> DeleteFirewall -> Bool)
-> (DeleteFirewall -> DeleteFirewall -> Bool) -> Eq DeleteFirewall
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFirewall -> DeleteFirewall -> Bool
$c/= :: DeleteFirewall -> DeleteFirewall -> Bool
== :: DeleteFirewall -> DeleteFirewall -> Bool
$c== :: DeleteFirewall -> DeleteFirewall -> Bool
Prelude.Eq, ReadPrec [DeleteFirewall]
ReadPrec DeleteFirewall
Int -> ReadS DeleteFirewall
ReadS [DeleteFirewall]
(Int -> ReadS DeleteFirewall)
-> ReadS [DeleteFirewall]
-> ReadPrec DeleteFirewall
-> ReadPrec [DeleteFirewall]
-> Read DeleteFirewall
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFirewall]
$creadListPrec :: ReadPrec [DeleteFirewall]
readPrec :: ReadPrec DeleteFirewall
$creadPrec :: ReadPrec DeleteFirewall
readList :: ReadS [DeleteFirewall]
$creadList :: ReadS [DeleteFirewall]
readsPrec :: Int -> ReadS DeleteFirewall
$creadsPrec :: Int -> ReadS DeleteFirewall
Prelude.Read, Int -> DeleteFirewall -> ShowS
[DeleteFirewall] -> ShowS
DeleteFirewall -> String
(Int -> DeleteFirewall -> ShowS)
-> (DeleteFirewall -> String)
-> ([DeleteFirewall] -> ShowS)
-> Show DeleteFirewall
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFirewall] -> ShowS
$cshowList :: [DeleteFirewall] -> ShowS
show :: DeleteFirewall -> String
$cshow :: DeleteFirewall -> String
showsPrec :: Int -> DeleteFirewall -> ShowS
$cshowsPrec :: Int -> DeleteFirewall -> ShowS
Prelude.Show, (forall x. DeleteFirewall -> Rep DeleteFirewall x)
-> (forall x. Rep DeleteFirewall x -> DeleteFirewall)
-> Generic DeleteFirewall
forall x. Rep DeleteFirewall x -> DeleteFirewall
forall x. DeleteFirewall -> Rep DeleteFirewall x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFirewall x -> DeleteFirewall
$cfrom :: forall x. DeleteFirewall -> Rep DeleteFirewall x
Prelude.Generic)
newDeleteFirewall ::
DeleteFirewall
newDeleteFirewall :: DeleteFirewall
newDeleteFirewall =
DeleteFirewall' :: Maybe Text -> Maybe Text -> DeleteFirewall
DeleteFirewall'
{ $sel:firewallArn:DeleteFirewall' :: Maybe Text
firewallArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:firewallName:DeleteFirewall' :: Maybe Text
firewallName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
deleteFirewall_firewallArn :: Lens.Lens' DeleteFirewall (Prelude.Maybe Prelude.Text)
deleteFirewall_firewallArn :: (Maybe Text -> f (Maybe Text))
-> DeleteFirewall -> f DeleteFirewall
deleteFirewall_firewallArn = (DeleteFirewall -> Maybe Text)
-> (DeleteFirewall -> Maybe Text -> DeleteFirewall)
-> Lens DeleteFirewall DeleteFirewall (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFirewall' {Maybe Text
firewallArn :: Maybe Text
$sel:firewallArn:DeleteFirewall' :: DeleteFirewall -> Maybe Text
firewallArn} -> Maybe Text
firewallArn) (\s :: DeleteFirewall
s@DeleteFirewall' {} Maybe Text
a -> DeleteFirewall
s {$sel:firewallArn:DeleteFirewall' :: Maybe Text
firewallArn = Maybe Text
a} :: DeleteFirewall)
deleteFirewall_firewallName :: Lens.Lens' DeleteFirewall (Prelude.Maybe Prelude.Text)
deleteFirewall_firewallName :: (Maybe Text -> f (Maybe Text))
-> DeleteFirewall -> f DeleteFirewall
deleteFirewall_firewallName = (DeleteFirewall -> Maybe Text)
-> (DeleteFirewall -> Maybe Text -> DeleteFirewall)
-> Lens DeleteFirewall DeleteFirewall (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFirewall' {Maybe Text
firewallName :: Maybe Text
$sel:firewallName:DeleteFirewall' :: DeleteFirewall -> Maybe Text
firewallName} -> Maybe Text
firewallName) (\s :: DeleteFirewall
s@DeleteFirewall' {} Maybe Text
a -> DeleteFirewall
s {$sel:firewallName:DeleteFirewall' :: Maybe Text
firewallName = Maybe Text
a} :: DeleteFirewall)
instance Core.AWSRequest DeleteFirewall where
type
AWSResponse DeleteFirewall =
DeleteFirewallResponse
request :: DeleteFirewall -> Request DeleteFirewall
request = Service -> DeleteFirewall -> Request DeleteFirewall
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteFirewall
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteFirewall)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteFirewall))
-> Logger
-> Service
-> Proxy DeleteFirewall
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteFirewall)))
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 FirewallStatus
-> Maybe Firewall -> Int -> DeleteFirewallResponse
DeleteFirewallResponse'
(Maybe FirewallStatus
-> Maybe Firewall -> Int -> DeleteFirewallResponse)
-> Either String (Maybe FirewallStatus)
-> Either String (Maybe Firewall -> Int -> DeleteFirewallResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe FirewallStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FirewallStatus")
Either String (Maybe Firewall -> Int -> DeleteFirewallResponse)
-> Either String (Maybe Firewall)
-> Either String (Int -> DeleteFirewallResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Firewall)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Firewall")
Either String (Int -> DeleteFirewallResponse)
-> Either String Int -> Either String DeleteFirewallResponse
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 DeleteFirewall
instance Prelude.NFData DeleteFirewall
instance Core.ToHeaders DeleteFirewall where
toHeaders :: DeleteFirewall -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteFirewall -> 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.DeleteFirewall" ::
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 DeleteFirewall where
toJSON :: DeleteFirewall -> Value
toJSON DeleteFirewall' {Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
$sel:firewallName:DeleteFirewall' :: DeleteFirewall -> Maybe Text
$sel:firewallArn:DeleteFirewall' :: DeleteFirewall -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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
]
)
instance Core.ToPath DeleteFirewall where
toPath :: DeleteFirewall -> ByteString
toPath = ByteString -> DeleteFirewall -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteFirewall where
toQuery :: DeleteFirewall -> QueryString
toQuery = QueryString -> DeleteFirewall -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteFirewallResponse = DeleteFirewallResponse'
{ DeleteFirewallResponse -> Maybe FirewallStatus
firewallStatus :: Prelude.Maybe FirewallStatus,
DeleteFirewallResponse -> Maybe Firewall
firewall :: Prelude.Maybe Firewall,
DeleteFirewallResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteFirewallResponse -> DeleteFirewallResponse -> Bool
(DeleteFirewallResponse -> DeleteFirewallResponse -> Bool)
-> (DeleteFirewallResponse -> DeleteFirewallResponse -> Bool)
-> Eq DeleteFirewallResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFirewallResponse -> DeleteFirewallResponse -> Bool
$c/= :: DeleteFirewallResponse -> DeleteFirewallResponse -> Bool
== :: DeleteFirewallResponse -> DeleteFirewallResponse -> Bool
$c== :: DeleteFirewallResponse -> DeleteFirewallResponse -> Bool
Prelude.Eq, ReadPrec [DeleteFirewallResponse]
ReadPrec DeleteFirewallResponse
Int -> ReadS DeleteFirewallResponse
ReadS [DeleteFirewallResponse]
(Int -> ReadS DeleteFirewallResponse)
-> ReadS [DeleteFirewallResponse]
-> ReadPrec DeleteFirewallResponse
-> ReadPrec [DeleteFirewallResponse]
-> Read DeleteFirewallResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFirewallResponse]
$creadListPrec :: ReadPrec [DeleteFirewallResponse]
readPrec :: ReadPrec DeleteFirewallResponse
$creadPrec :: ReadPrec DeleteFirewallResponse
readList :: ReadS [DeleteFirewallResponse]
$creadList :: ReadS [DeleteFirewallResponse]
readsPrec :: Int -> ReadS DeleteFirewallResponse
$creadsPrec :: Int -> ReadS DeleteFirewallResponse
Prelude.Read, Int -> DeleteFirewallResponse -> ShowS
[DeleteFirewallResponse] -> ShowS
DeleteFirewallResponse -> String
(Int -> DeleteFirewallResponse -> ShowS)
-> (DeleteFirewallResponse -> String)
-> ([DeleteFirewallResponse] -> ShowS)
-> Show DeleteFirewallResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFirewallResponse] -> ShowS
$cshowList :: [DeleteFirewallResponse] -> ShowS
show :: DeleteFirewallResponse -> String
$cshow :: DeleteFirewallResponse -> String
showsPrec :: Int -> DeleteFirewallResponse -> ShowS
$cshowsPrec :: Int -> DeleteFirewallResponse -> ShowS
Prelude.Show, (forall x. DeleteFirewallResponse -> Rep DeleteFirewallResponse x)
-> (forall x.
Rep DeleteFirewallResponse x -> DeleteFirewallResponse)
-> Generic DeleteFirewallResponse
forall x. Rep DeleteFirewallResponse x -> DeleteFirewallResponse
forall x. DeleteFirewallResponse -> Rep DeleteFirewallResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFirewallResponse x -> DeleteFirewallResponse
$cfrom :: forall x. DeleteFirewallResponse -> Rep DeleteFirewallResponse x
Prelude.Generic)
newDeleteFirewallResponse ::
Prelude.Int ->
DeleteFirewallResponse
newDeleteFirewallResponse :: Int -> DeleteFirewallResponse
newDeleteFirewallResponse Int
pHttpStatus_ =
DeleteFirewallResponse' :: Maybe FirewallStatus
-> Maybe Firewall -> Int -> DeleteFirewallResponse
DeleteFirewallResponse'
{ $sel:firewallStatus:DeleteFirewallResponse' :: Maybe FirewallStatus
firewallStatus =
Maybe FirewallStatus
forall a. Maybe a
Prelude.Nothing,
$sel:firewall:DeleteFirewallResponse' :: Maybe Firewall
firewall = Maybe Firewall
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteFirewallResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteFirewallResponse_firewallStatus :: Lens.Lens' DeleteFirewallResponse (Prelude.Maybe FirewallStatus)
deleteFirewallResponse_firewallStatus :: (Maybe FirewallStatus -> f (Maybe FirewallStatus))
-> DeleteFirewallResponse -> f DeleteFirewallResponse
deleteFirewallResponse_firewallStatus = (DeleteFirewallResponse -> Maybe FirewallStatus)
-> (DeleteFirewallResponse
-> Maybe FirewallStatus -> DeleteFirewallResponse)
-> Lens
DeleteFirewallResponse
DeleteFirewallResponse
(Maybe FirewallStatus)
(Maybe FirewallStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFirewallResponse' {Maybe FirewallStatus
firewallStatus :: Maybe FirewallStatus
$sel:firewallStatus:DeleteFirewallResponse' :: DeleteFirewallResponse -> Maybe FirewallStatus
firewallStatus} -> Maybe FirewallStatus
firewallStatus) (\s :: DeleteFirewallResponse
s@DeleteFirewallResponse' {} Maybe FirewallStatus
a -> DeleteFirewallResponse
s {$sel:firewallStatus:DeleteFirewallResponse' :: Maybe FirewallStatus
firewallStatus = Maybe FirewallStatus
a} :: DeleteFirewallResponse)
deleteFirewallResponse_firewall :: Lens.Lens' DeleteFirewallResponse (Prelude.Maybe Firewall)
deleteFirewallResponse_firewall :: (Maybe Firewall -> f (Maybe Firewall))
-> DeleteFirewallResponse -> f DeleteFirewallResponse
deleteFirewallResponse_firewall = (DeleteFirewallResponse -> Maybe Firewall)
-> (DeleteFirewallResponse
-> Maybe Firewall -> DeleteFirewallResponse)
-> Lens
DeleteFirewallResponse
DeleteFirewallResponse
(Maybe Firewall)
(Maybe Firewall)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFirewallResponse' {Maybe Firewall
firewall :: Maybe Firewall
$sel:firewall:DeleteFirewallResponse' :: DeleteFirewallResponse -> Maybe Firewall
firewall} -> Maybe Firewall
firewall) (\s :: DeleteFirewallResponse
s@DeleteFirewallResponse' {} Maybe Firewall
a -> DeleteFirewallResponse
s {$sel:firewall:DeleteFirewallResponse' :: Maybe Firewall
firewall = Maybe Firewall
a} :: DeleteFirewallResponse)
deleteFirewallResponse_httpStatus :: Lens.Lens' DeleteFirewallResponse Prelude.Int
deleteFirewallResponse_httpStatus :: (Int -> f Int)
-> DeleteFirewallResponse -> f DeleteFirewallResponse
deleteFirewallResponse_httpStatus = (DeleteFirewallResponse -> Int)
-> (DeleteFirewallResponse -> Int -> DeleteFirewallResponse)
-> Lens DeleteFirewallResponse DeleteFirewallResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFirewallResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteFirewallResponse' :: DeleteFirewallResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteFirewallResponse
s@DeleteFirewallResponse' {} Int
a -> DeleteFirewallResponse
s {$sel:httpStatus:DeleteFirewallResponse' :: Int
httpStatus = Int
a} :: DeleteFirewallResponse)
instance Prelude.NFData DeleteFirewallResponse