{-# 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_firewall,
deleteFirewallResponse_firewallStatus,
deleteFirewallResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:firewallArn:DeleteFirewall' :: Maybe Text
firewallArn = forall a. Maybe a
Prelude.Nothing,
$sel:firewallName:DeleteFirewall' :: Maybe Text
firewallName = forall a. Maybe a
Prelude.Nothing
}
deleteFirewall_firewallArn :: Lens.Lens' DeleteFirewall (Prelude.Maybe Prelude.Text)
deleteFirewall_firewallArn :: Lens' DeleteFirewall (Maybe Text)
deleteFirewall_firewallArn = 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 :: Lens' DeleteFirewall (Maybe Text)
deleteFirewall_firewallName = 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 :: (Service -> Service) -> DeleteFirewall -> Request DeleteFirewall
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteFirewall
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteFirewall)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Firewall
-> Maybe FirewallStatus -> Int -> DeleteFirewallResponse
DeleteFirewallResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Firewall")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"FirewallStatus")
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 DeleteFirewall where
hashWithSalt :: Int -> DeleteFirewall -> Int
hashWithSalt Int
_salt DeleteFirewall' {Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
$sel:firewallName:DeleteFirewall' :: DeleteFirewall -> Maybe Text
$sel:firewallArn:DeleteFirewall' :: DeleteFirewall -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
firewallArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
firewallName
instance Prelude.NFData DeleteFirewall where
rnf :: DeleteFirewall -> ()
rnf DeleteFirewall' {Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
$sel:firewallName:DeleteFirewall' :: DeleteFirewall -> Maybe Text
$sel:firewallArn:DeleteFirewall' :: DeleteFirewall -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
firewallArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
firewallName
instance Data.ToHeaders DeleteFirewall where
toHeaders :: DeleteFirewall -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"NetworkFirewall_20201112.DeleteFirewall" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"FirewallArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
firewallArn,
(Key
"FirewallName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
firewallName
]
)
instance Data.ToPath DeleteFirewall where
toPath :: DeleteFirewall -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteFirewall where
toQuery :: DeleteFirewall -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteFirewallResponse = DeleteFirewallResponse'
{ DeleteFirewallResponse -> Maybe Firewall
firewall :: Prelude.Maybe Firewall,
DeleteFirewallResponse -> Maybe FirewallStatus
firewallStatus :: Prelude.Maybe FirewallStatus,
DeleteFirewallResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteFirewallResponse -> DeleteFirewallResponse -> Bool
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]
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
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. 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'
{ $sel:firewall:DeleteFirewallResponse' :: Maybe Firewall
firewall = forall a. Maybe a
Prelude.Nothing,
$sel:firewallStatus:DeleteFirewallResponse' :: Maybe FirewallStatus
firewallStatus = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteFirewallResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteFirewallResponse_firewall :: Lens.Lens' DeleteFirewallResponse (Prelude.Maybe Firewall)
deleteFirewallResponse_firewall :: Lens' DeleteFirewallResponse (Maybe Firewall)
deleteFirewallResponse_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_firewallStatus :: Lens.Lens' DeleteFirewallResponse (Prelude.Maybe FirewallStatus)
deleteFirewallResponse_firewallStatus :: Lens' DeleteFirewallResponse (Maybe FirewallStatus)
deleteFirewallResponse_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_httpStatus :: Lens.Lens' DeleteFirewallResponse Prelude.Int
deleteFirewallResponse_httpStatus :: Lens' DeleteFirewallResponse Int
deleteFirewallResponse_httpStatus = 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 where
rnf :: DeleteFirewallResponse -> ()
rnf DeleteFirewallResponse' {Int
Maybe FirewallStatus
Maybe Firewall
httpStatus :: Int
firewallStatus :: Maybe FirewallStatus
firewall :: Maybe Firewall
$sel:httpStatus:DeleteFirewallResponse' :: DeleteFirewallResponse -> Int
$sel:firewallStatus:DeleteFirewallResponse' :: DeleteFirewallResponse -> Maybe FirewallStatus
$sel:firewall:DeleteFirewallResponse' :: DeleteFirewallResponse -> Maybe Firewall
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Firewall
firewall
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FirewallStatus
firewallStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus