{-# 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.Route53Resolver.DeleteFirewallRule
(
DeleteFirewallRule (..),
newDeleteFirewallRule,
deleteFirewallRule_firewallRuleGroupId,
deleteFirewallRule_firewallDomainListId,
DeleteFirewallRuleResponse (..),
newDeleteFirewallRuleResponse,
deleteFirewallRuleResponse_firewallRule,
deleteFirewallRuleResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53Resolver.Types
data DeleteFirewallRule = DeleteFirewallRule'
{
DeleteFirewallRule -> Text
firewallRuleGroupId :: Prelude.Text,
DeleteFirewallRule -> Text
firewallDomainListId :: Prelude.Text
}
deriving (DeleteFirewallRule -> DeleteFirewallRule -> Bool
(DeleteFirewallRule -> DeleteFirewallRule -> Bool)
-> (DeleteFirewallRule -> DeleteFirewallRule -> Bool)
-> Eq DeleteFirewallRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFirewallRule -> DeleteFirewallRule -> Bool
$c/= :: DeleteFirewallRule -> DeleteFirewallRule -> Bool
== :: DeleteFirewallRule -> DeleteFirewallRule -> Bool
$c== :: DeleteFirewallRule -> DeleteFirewallRule -> Bool
Prelude.Eq, ReadPrec [DeleteFirewallRule]
ReadPrec DeleteFirewallRule
Int -> ReadS DeleteFirewallRule
ReadS [DeleteFirewallRule]
(Int -> ReadS DeleteFirewallRule)
-> ReadS [DeleteFirewallRule]
-> ReadPrec DeleteFirewallRule
-> ReadPrec [DeleteFirewallRule]
-> Read DeleteFirewallRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFirewallRule]
$creadListPrec :: ReadPrec [DeleteFirewallRule]
readPrec :: ReadPrec DeleteFirewallRule
$creadPrec :: ReadPrec DeleteFirewallRule
readList :: ReadS [DeleteFirewallRule]
$creadList :: ReadS [DeleteFirewallRule]
readsPrec :: Int -> ReadS DeleteFirewallRule
$creadsPrec :: Int -> ReadS DeleteFirewallRule
Prelude.Read, Int -> DeleteFirewallRule -> ShowS
[DeleteFirewallRule] -> ShowS
DeleteFirewallRule -> String
(Int -> DeleteFirewallRule -> ShowS)
-> (DeleteFirewallRule -> String)
-> ([DeleteFirewallRule] -> ShowS)
-> Show DeleteFirewallRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFirewallRule] -> ShowS
$cshowList :: [DeleteFirewallRule] -> ShowS
show :: DeleteFirewallRule -> String
$cshow :: DeleteFirewallRule -> String
showsPrec :: Int -> DeleteFirewallRule -> ShowS
$cshowsPrec :: Int -> DeleteFirewallRule -> ShowS
Prelude.Show, (forall x. DeleteFirewallRule -> Rep DeleteFirewallRule x)
-> (forall x. Rep DeleteFirewallRule x -> DeleteFirewallRule)
-> Generic DeleteFirewallRule
forall x. Rep DeleteFirewallRule x -> DeleteFirewallRule
forall x. DeleteFirewallRule -> Rep DeleteFirewallRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFirewallRule x -> DeleteFirewallRule
$cfrom :: forall x. DeleteFirewallRule -> Rep DeleteFirewallRule x
Prelude.Generic)
newDeleteFirewallRule ::
Prelude.Text ->
Prelude.Text ->
DeleteFirewallRule
newDeleteFirewallRule :: Text -> Text -> DeleteFirewallRule
newDeleteFirewallRule
Text
pFirewallRuleGroupId_
Text
pFirewallDomainListId_ =
DeleteFirewallRule' :: Text -> Text -> DeleteFirewallRule
DeleteFirewallRule'
{ $sel:firewallRuleGroupId:DeleteFirewallRule' :: Text
firewallRuleGroupId =
Text
pFirewallRuleGroupId_,
$sel:firewallDomainListId:DeleteFirewallRule' :: Text
firewallDomainListId = Text
pFirewallDomainListId_
}
deleteFirewallRule_firewallRuleGroupId :: Lens.Lens' DeleteFirewallRule Prelude.Text
deleteFirewallRule_firewallRuleGroupId :: (Text -> f Text) -> DeleteFirewallRule -> f DeleteFirewallRule
deleteFirewallRule_firewallRuleGroupId = (DeleteFirewallRule -> Text)
-> (DeleteFirewallRule -> Text -> DeleteFirewallRule)
-> Lens DeleteFirewallRule DeleteFirewallRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFirewallRule' {Text
firewallRuleGroupId :: Text
$sel:firewallRuleGroupId:DeleteFirewallRule' :: DeleteFirewallRule -> Text
firewallRuleGroupId} -> Text
firewallRuleGroupId) (\s :: DeleteFirewallRule
s@DeleteFirewallRule' {} Text
a -> DeleteFirewallRule
s {$sel:firewallRuleGroupId:DeleteFirewallRule' :: Text
firewallRuleGroupId = Text
a} :: DeleteFirewallRule)
deleteFirewallRule_firewallDomainListId :: Lens.Lens' DeleteFirewallRule Prelude.Text
deleteFirewallRule_firewallDomainListId :: (Text -> f Text) -> DeleteFirewallRule -> f DeleteFirewallRule
deleteFirewallRule_firewallDomainListId = (DeleteFirewallRule -> Text)
-> (DeleteFirewallRule -> Text -> DeleteFirewallRule)
-> Lens DeleteFirewallRule DeleteFirewallRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFirewallRule' {Text
firewallDomainListId :: Text
$sel:firewallDomainListId:DeleteFirewallRule' :: DeleteFirewallRule -> Text
firewallDomainListId} -> Text
firewallDomainListId) (\s :: DeleteFirewallRule
s@DeleteFirewallRule' {} Text
a -> DeleteFirewallRule
s {$sel:firewallDomainListId:DeleteFirewallRule' :: Text
firewallDomainListId = Text
a} :: DeleteFirewallRule)
instance Core.AWSRequest DeleteFirewallRule where
type
AWSResponse DeleteFirewallRule =
DeleteFirewallRuleResponse
request :: DeleteFirewallRule -> Request DeleteFirewallRule
request = Service -> DeleteFirewallRule -> Request DeleteFirewallRule
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteFirewallRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteFirewallRule)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteFirewallRule))
-> Logger
-> Service
-> Proxy DeleteFirewallRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteFirewallRule)))
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 FirewallRule -> Int -> DeleteFirewallRuleResponse
DeleteFirewallRuleResponse'
(Maybe FirewallRule -> Int -> DeleteFirewallRuleResponse)
-> Either String (Maybe FirewallRule)
-> Either String (Int -> DeleteFirewallRuleResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe FirewallRule)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FirewallRule")
Either String (Int -> DeleteFirewallRuleResponse)
-> Either String Int -> Either String DeleteFirewallRuleResponse
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 DeleteFirewallRule
instance Prelude.NFData DeleteFirewallRule
instance Core.ToHeaders DeleteFirewallRule where
toHeaders :: DeleteFirewallRule -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteFirewallRule -> 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
"Route53Resolver.DeleteFirewallRule" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteFirewallRule where
toJSON :: DeleteFirewallRule -> Value
toJSON DeleteFirewallRule' {Text
firewallDomainListId :: Text
firewallRuleGroupId :: Text
$sel:firewallDomainListId:DeleteFirewallRule' :: DeleteFirewallRule -> Text
$sel:firewallRuleGroupId:DeleteFirewallRule' :: DeleteFirewallRule -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"FirewallRuleGroupId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
firewallRuleGroupId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"FirewallDomainListId"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
firewallDomainListId
)
]
)
instance Core.ToPath DeleteFirewallRule where
toPath :: DeleteFirewallRule -> ByteString
toPath = ByteString -> DeleteFirewallRule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteFirewallRule where
toQuery :: DeleteFirewallRule -> QueryString
toQuery = QueryString -> DeleteFirewallRule -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteFirewallRuleResponse = DeleteFirewallRuleResponse'
{
DeleteFirewallRuleResponse -> Maybe FirewallRule
firewallRule :: Prelude.Maybe FirewallRule,
DeleteFirewallRuleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteFirewallRuleResponse -> DeleteFirewallRuleResponse -> Bool
(DeleteFirewallRuleResponse -> DeleteFirewallRuleResponse -> Bool)
-> (DeleteFirewallRuleResponse
-> DeleteFirewallRuleResponse -> Bool)
-> Eq DeleteFirewallRuleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFirewallRuleResponse -> DeleteFirewallRuleResponse -> Bool
$c/= :: DeleteFirewallRuleResponse -> DeleteFirewallRuleResponse -> Bool
== :: DeleteFirewallRuleResponse -> DeleteFirewallRuleResponse -> Bool
$c== :: DeleteFirewallRuleResponse -> DeleteFirewallRuleResponse -> Bool
Prelude.Eq, ReadPrec [DeleteFirewallRuleResponse]
ReadPrec DeleteFirewallRuleResponse
Int -> ReadS DeleteFirewallRuleResponse
ReadS [DeleteFirewallRuleResponse]
(Int -> ReadS DeleteFirewallRuleResponse)
-> ReadS [DeleteFirewallRuleResponse]
-> ReadPrec DeleteFirewallRuleResponse
-> ReadPrec [DeleteFirewallRuleResponse]
-> Read DeleteFirewallRuleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFirewallRuleResponse]
$creadListPrec :: ReadPrec [DeleteFirewallRuleResponse]
readPrec :: ReadPrec DeleteFirewallRuleResponse
$creadPrec :: ReadPrec DeleteFirewallRuleResponse
readList :: ReadS [DeleteFirewallRuleResponse]
$creadList :: ReadS [DeleteFirewallRuleResponse]
readsPrec :: Int -> ReadS DeleteFirewallRuleResponse
$creadsPrec :: Int -> ReadS DeleteFirewallRuleResponse
Prelude.Read, Int -> DeleteFirewallRuleResponse -> ShowS
[DeleteFirewallRuleResponse] -> ShowS
DeleteFirewallRuleResponse -> String
(Int -> DeleteFirewallRuleResponse -> ShowS)
-> (DeleteFirewallRuleResponse -> String)
-> ([DeleteFirewallRuleResponse] -> ShowS)
-> Show DeleteFirewallRuleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFirewallRuleResponse] -> ShowS
$cshowList :: [DeleteFirewallRuleResponse] -> ShowS
show :: DeleteFirewallRuleResponse -> String
$cshow :: DeleteFirewallRuleResponse -> String
showsPrec :: Int -> DeleteFirewallRuleResponse -> ShowS
$cshowsPrec :: Int -> DeleteFirewallRuleResponse -> ShowS
Prelude.Show, (forall x.
DeleteFirewallRuleResponse -> Rep DeleteFirewallRuleResponse x)
-> (forall x.
Rep DeleteFirewallRuleResponse x -> DeleteFirewallRuleResponse)
-> Generic DeleteFirewallRuleResponse
forall x.
Rep DeleteFirewallRuleResponse x -> DeleteFirewallRuleResponse
forall x.
DeleteFirewallRuleResponse -> Rep DeleteFirewallRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteFirewallRuleResponse x -> DeleteFirewallRuleResponse
$cfrom :: forall x.
DeleteFirewallRuleResponse -> Rep DeleteFirewallRuleResponse x
Prelude.Generic)
newDeleteFirewallRuleResponse ::
Prelude.Int ->
DeleteFirewallRuleResponse
newDeleteFirewallRuleResponse :: Int -> DeleteFirewallRuleResponse
newDeleteFirewallRuleResponse Int
pHttpStatus_ =
DeleteFirewallRuleResponse' :: Maybe FirewallRule -> Int -> DeleteFirewallRuleResponse
DeleteFirewallRuleResponse'
{ $sel:firewallRule:DeleteFirewallRuleResponse' :: Maybe FirewallRule
firewallRule =
Maybe FirewallRule
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteFirewallRuleResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteFirewallRuleResponse_firewallRule :: Lens.Lens' DeleteFirewallRuleResponse (Prelude.Maybe FirewallRule)
deleteFirewallRuleResponse_firewallRule :: (Maybe FirewallRule -> f (Maybe FirewallRule))
-> DeleteFirewallRuleResponse -> f DeleteFirewallRuleResponse
deleteFirewallRuleResponse_firewallRule = (DeleteFirewallRuleResponse -> Maybe FirewallRule)
-> (DeleteFirewallRuleResponse
-> Maybe FirewallRule -> DeleteFirewallRuleResponse)
-> Lens
DeleteFirewallRuleResponse
DeleteFirewallRuleResponse
(Maybe FirewallRule)
(Maybe FirewallRule)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFirewallRuleResponse' {Maybe FirewallRule
firewallRule :: Maybe FirewallRule
$sel:firewallRule:DeleteFirewallRuleResponse' :: DeleteFirewallRuleResponse -> Maybe FirewallRule
firewallRule} -> Maybe FirewallRule
firewallRule) (\s :: DeleteFirewallRuleResponse
s@DeleteFirewallRuleResponse' {} Maybe FirewallRule
a -> DeleteFirewallRuleResponse
s {$sel:firewallRule:DeleteFirewallRuleResponse' :: Maybe FirewallRule
firewallRule = Maybe FirewallRule
a} :: DeleteFirewallRuleResponse)
deleteFirewallRuleResponse_httpStatus :: Lens.Lens' DeleteFirewallRuleResponse Prelude.Int
deleteFirewallRuleResponse_httpStatus :: (Int -> f Int)
-> DeleteFirewallRuleResponse -> f DeleteFirewallRuleResponse
deleteFirewallRuleResponse_httpStatus = (DeleteFirewallRuleResponse -> Int)
-> (DeleteFirewallRuleResponse
-> Int -> DeleteFirewallRuleResponse)
-> Lens
DeleteFirewallRuleResponse DeleteFirewallRuleResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFirewallRuleResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteFirewallRuleResponse' :: DeleteFirewallRuleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteFirewallRuleResponse
s@DeleteFirewallRuleResponse' {} Int
a -> DeleteFirewallRuleResponse
s {$sel:httpStatus:DeleteFirewallRuleResponse' :: Int
httpStatus = Int
a} :: DeleteFirewallRuleResponse)
instance Prelude.NFData DeleteFirewallRuleResponse