{-# 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.DisassociateResolverRule
(
DisassociateResolverRule (..),
newDisassociateResolverRule,
disassociateResolverRule_vPCId,
disassociateResolverRule_resolverRuleId,
DisassociateResolverRuleResponse (..),
newDisassociateResolverRuleResponse,
disassociateResolverRuleResponse_resolverRuleAssociation,
disassociateResolverRuleResponse_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 DisassociateResolverRule = DisassociateResolverRule'
{
DisassociateResolverRule -> Text
vPCId :: Prelude.Text,
DisassociateResolverRule -> Text
resolverRuleId :: Prelude.Text
}
deriving (DisassociateResolverRule -> DisassociateResolverRule -> Bool
(DisassociateResolverRule -> DisassociateResolverRule -> Bool)
-> (DisassociateResolverRule -> DisassociateResolverRule -> Bool)
-> Eq DisassociateResolverRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateResolverRule -> DisassociateResolverRule -> Bool
$c/= :: DisassociateResolverRule -> DisassociateResolverRule -> Bool
== :: DisassociateResolverRule -> DisassociateResolverRule -> Bool
$c== :: DisassociateResolverRule -> DisassociateResolverRule -> Bool
Prelude.Eq, ReadPrec [DisassociateResolverRule]
ReadPrec DisassociateResolverRule
Int -> ReadS DisassociateResolverRule
ReadS [DisassociateResolverRule]
(Int -> ReadS DisassociateResolverRule)
-> ReadS [DisassociateResolverRule]
-> ReadPrec DisassociateResolverRule
-> ReadPrec [DisassociateResolverRule]
-> Read DisassociateResolverRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateResolverRule]
$creadListPrec :: ReadPrec [DisassociateResolverRule]
readPrec :: ReadPrec DisassociateResolverRule
$creadPrec :: ReadPrec DisassociateResolverRule
readList :: ReadS [DisassociateResolverRule]
$creadList :: ReadS [DisassociateResolverRule]
readsPrec :: Int -> ReadS DisassociateResolverRule
$creadsPrec :: Int -> ReadS DisassociateResolverRule
Prelude.Read, Int -> DisassociateResolverRule -> ShowS
[DisassociateResolverRule] -> ShowS
DisassociateResolverRule -> String
(Int -> DisassociateResolverRule -> ShowS)
-> (DisassociateResolverRule -> String)
-> ([DisassociateResolverRule] -> ShowS)
-> Show DisassociateResolverRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateResolverRule] -> ShowS
$cshowList :: [DisassociateResolverRule] -> ShowS
show :: DisassociateResolverRule -> String
$cshow :: DisassociateResolverRule -> String
showsPrec :: Int -> DisassociateResolverRule -> ShowS
$cshowsPrec :: Int -> DisassociateResolverRule -> ShowS
Prelude.Show, (forall x.
DisassociateResolverRule -> Rep DisassociateResolverRule x)
-> (forall x.
Rep DisassociateResolverRule x -> DisassociateResolverRule)
-> Generic DisassociateResolverRule
forall x.
Rep DisassociateResolverRule x -> DisassociateResolverRule
forall x.
DisassociateResolverRule -> Rep DisassociateResolverRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateResolverRule x -> DisassociateResolverRule
$cfrom :: forall x.
DisassociateResolverRule -> Rep DisassociateResolverRule x
Prelude.Generic)
newDisassociateResolverRule ::
Prelude.Text ->
Prelude.Text ->
DisassociateResolverRule
newDisassociateResolverRule :: Text -> Text -> DisassociateResolverRule
newDisassociateResolverRule Text
pVPCId_ Text
pResolverRuleId_ =
DisassociateResolverRule' :: Text -> Text -> DisassociateResolverRule
DisassociateResolverRule'
{ $sel:vPCId:DisassociateResolverRule' :: Text
vPCId = Text
pVPCId_,
$sel:resolverRuleId:DisassociateResolverRule' :: Text
resolverRuleId = Text
pResolverRuleId_
}
disassociateResolverRule_vPCId :: Lens.Lens' DisassociateResolverRule Prelude.Text
disassociateResolverRule_vPCId :: (Text -> f Text)
-> DisassociateResolverRule -> f DisassociateResolverRule
disassociateResolverRule_vPCId = (DisassociateResolverRule -> Text)
-> (DisassociateResolverRule -> Text -> DisassociateResolverRule)
-> Lens DisassociateResolverRule DisassociateResolverRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateResolverRule' {Text
vPCId :: Text
$sel:vPCId:DisassociateResolverRule' :: DisassociateResolverRule -> Text
vPCId} -> Text
vPCId) (\s :: DisassociateResolverRule
s@DisassociateResolverRule' {} Text
a -> DisassociateResolverRule
s {$sel:vPCId:DisassociateResolverRule' :: Text
vPCId = Text
a} :: DisassociateResolverRule)
disassociateResolverRule_resolverRuleId :: Lens.Lens' DisassociateResolverRule Prelude.Text
disassociateResolverRule_resolverRuleId :: (Text -> f Text)
-> DisassociateResolverRule -> f DisassociateResolverRule
disassociateResolverRule_resolverRuleId = (DisassociateResolverRule -> Text)
-> (DisassociateResolverRule -> Text -> DisassociateResolverRule)
-> Lens DisassociateResolverRule DisassociateResolverRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateResolverRule' {Text
resolverRuleId :: Text
$sel:resolverRuleId:DisassociateResolverRule' :: DisassociateResolverRule -> Text
resolverRuleId} -> Text
resolverRuleId) (\s :: DisassociateResolverRule
s@DisassociateResolverRule' {} Text
a -> DisassociateResolverRule
s {$sel:resolverRuleId:DisassociateResolverRule' :: Text
resolverRuleId = Text
a} :: DisassociateResolverRule)
instance Core.AWSRequest DisassociateResolverRule where
type
AWSResponse DisassociateResolverRule =
DisassociateResolverRuleResponse
request :: DisassociateResolverRule -> Request DisassociateResolverRule
request = Service
-> DisassociateResolverRule -> Request DisassociateResolverRule
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DisassociateResolverRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateResolverRule)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DisassociateResolverRule))
-> Logger
-> Service
-> Proxy DisassociateResolverRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateResolverRule)))
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 ResolverRuleAssociation
-> Int -> DisassociateResolverRuleResponse
DisassociateResolverRuleResponse'
(Maybe ResolverRuleAssociation
-> Int -> DisassociateResolverRuleResponse)
-> Either String (Maybe ResolverRuleAssociation)
-> Either String (Int -> DisassociateResolverRuleResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ResolverRuleAssociation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ResolverRuleAssociation")
Either String (Int -> DisassociateResolverRuleResponse)
-> Either String Int
-> Either String DisassociateResolverRuleResponse
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 DisassociateResolverRule
instance Prelude.NFData DisassociateResolverRule
instance Core.ToHeaders DisassociateResolverRule where
toHeaders :: DisassociateResolverRule -> ResponseHeaders
toHeaders =
ResponseHeaders -> DisassociateResolverRule -> 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.DisassociateResolverRule" ::
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 DisassociateResolverRule where
toJSON :: DisassociateResolverRule -> Value
toJSON DisassociateResolverRule' {Text
resolverRuleId :: Text
vPCId :: Text
$sel:resolverRuleId:DisassociateResolverRule' :: DisassociateResolverRule -> Text
$sel:vPCId:DisassociateResolverRule' :: DisassociateResolverRule -> 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
"VPCId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
vPCId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ResolverRuleId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resolverRuleId)
]
)
instance Core.ToPath DisassociateResolverRule where
toPath :: DisassociateResolverRule -> ByteString
toPath = ByteString -> DisassociateResolverRule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DisassociateResolverRule where
toQuery :: DisassociateResolverRule -> QueryString
toQuery = QueryString -> DisassociateResolverRule -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DisassociateResolverRuleResponse = DisassociateResolverRuleResponse'
{
DisassociateResolverRuleResponse -> Maybe ResolverRuleAssociation
resolverRuleAssociation :: Prelude.Maybe ResolverRuleAssociation,
DisassociateResolverRuleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateResolverRuleResponse
-> DisassociateResolverRuleResponse -> Bool
(DisassociateResolverRuleResponse
-> DisassociateResolverRuleResponse -> Bool)
-> (DisassociateResolverRuleResponse
-> DisassociateResolverRuleResponse -> Bool)
-> Eq DisassociateResolverRuleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateResolverRuleResponse
-> DisassociateResolverRuleResponse -> Bool
$c/= :: DisassociateResolverRuleResponse
-> DisassociateResolverRuleResponse -> Bool
== :: DisassociateResolverRuleResponse
-> DisassociateResolverRuleResponse -> Bool
$c== :: DisassociateResolverRuleResponse
-> DisassociateResolverRuleResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateResolverRuleResponse]
ReadPrec DisassociateResolverRuleResponse
Int -> ReadS DisassociateResolverRuleResponse
ReadS [DisassociateResolverRuleResponse]
(Int -> ReadS DisassociateResolverRuleResponse)
-> ReadS [DisassociateResolverRuleResponse]
-> ReadPrec DisassociateResolverRuleResponse
-> ReadPrec [DisassociateResolverRuleResponse]
-> Read DisassociateResolverRuleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateResolverRuleResponse]
$creadListPrec :: ReadPrec [DisassociateResolverRuleResponse]
readPrec :: ReadPrec DisassociateResolverRuleResponse
$creadPrec :: ReadPrec DisassociateResolverRuleResponse
readList :: ReadS [DisassociateResolverRuleResponse]
$creadList :: ReadS [DisassociateResolverRuleResponse]
readsPrec :: Int -> ReadS DisassociateResolverRuleResponse
$creadsPrec :: Int -> ReadS DisassociateResolverRuleResponse
Prelude.Read, Int -> DisassociateResolverRuleResponse -> ShowS
[DisassociateResolverRuleResponse] -> ShowS
DisassociateResolverRuleResponse -> String
(Int -> DisassociateResolverRuleResponse -> ShowS)
-> (DisassociateResolverRuleResponse -> String)
-> ([DisassociateResolverRuleResponse] -> ShowS)
-> Show DisassociateResolverRuleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateResolverRuleResponse] -> ShowS
$cshowList :: [DisassociateResolverRuleResponse] -> ShowS
show :: DisassociateResolverRuleResponse -> String
$cshow :: DisassociateResolverRuleResponse -> String
showsPrec :: Int -> DisassociateResolverRuleResponse -> ShowS
$cshowsPrec :: Int -> DisassociateResolverRuleResponse -> ShowS
Prelude.Show, (forall x.
DisassociateResolverRuleResponse
-> Rep DisassociateResolverRuleResponse x)
-> (forall x.
Rep DisassociateResolverRuleResponse x
-> DisassociateResolverRuleResponse)
-> Generic DisassociateResolverRuleResponse
forall x.
Rep DisassociateResolverRuleResponse x
-> DisassociateResolverRuleResponse
forall x.
DisassociateResolverRuleResponse
-> Rep DisassociateResolverRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateResolverRuleResponse x
-> DisassociateResolverRuleResponse
$cfrom :: forall x.
DisassociateResolverRuleResponse
-> Rep DisassociateResolverRuleResponse x
Prelude.Generic)
newDisassociateResolverRuleResponse ::
Prelude.Int ->
DisassociateResolverRuleResponse
newDisassociateResolverRuleResponse :: Int -> DisassociateResolverRuleResponse
newDisassociateResolverRuleResponse Int
pHttpStatus_ =
DisassociateResolverRuleResponse' :: Maybe ResolverRuleAssociation
-> Int -> DisassociateResolverRuleResponse
DisassociateResolverRuleResponse'
{ $sel:resolverRuleAssociation:DisassociateResolverRuleResponse' :: Maybe ResolverRuleAssociation
resolverRuleAssociation =
Maybe ResolverRuleAssociation
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DisassociateResolverRuleResponse' :: Int
httpStatus = Int
pHttpStatus_
}
disassociateResolverRuleResponse_resolverRuleAssociation :: Lens.Lens' DisassociateResolverRuleResponse (Prelude.Maybe ResolverRuleAssociation)
disassociateResolverRuleResponse_resolverRuleAssociation :: (Maybe ResolverRuleAssociation
-> f (Maybe ResolverRuleAssociation))
-> DisassociateResolverRuleResponse
-> f DisassociateResolverRuleResponse
disassociateResolverRuleResponse_resolverRuleAssociation = (DisassociateResolverRuleResponse -> Maybe ResolverRuleAssociation)
-> (DisassociateResolverRuleResponse
-> Maybe ResolverRuleAssociation
-> DisassociateResolverRuleResponse)
-> Lens
DisassociateResolverRuleResponse
DisassociateResolverRuleResponse
(Maybe ResolverRuleAssociation)
(Maybe ResolverRuleAssociation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateResolverRuleResponse' {Maybe ResolverRuleAssociation
resolverRuleAssociation :: Maybe ResolverRuleAssociation
$sel:resolverRuleAssociation:DisassociateResolverRuleResponse' :: DisassociateResolverRuleResponse -> Maybe ResolverRuleAssociation
resolverRuleAssociation} -> Maybe ResolverRuleAssociation
resolverRuleAssociation) (\s :: DisassociateResolverRuleResponse
s@DisassociateResolverRuleResponse' {} Maybe ResolverRuleAssociation
a -> DisassociateResolverRuleResponse
s {$sel:resolverRuleAssociation:DisassociateResolverRuleResponse' :: Maybe ResolverRuleAssociation
resolverRuleAssociation = Maybe ResolverRuleAssociation
a} :: DisassociateResolverRuleResponse)
disassociateResolverRuleResponse_httpStatus :: Lens.Lens' DisassociateResolverRuleResponse Prelude.Int
disassociateResolverRuleResponse_httpStatus :: (Int -> f Int)
-> DisassociateResolverRuleResponse
-> f DisassociateResolverRuleResponse
disassociateResolverRuleResponse_httpStatus = (DisassociateResolverRuleResponse -> Int)
-> (DisassociateResolverRuleResponse
-> Int -> DisassociateResolverRuleResponse)
-> Lens
DisassociateResolverRuleResponse
DisassociateResolverRuleResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateResolverRuleResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateResolverRuleResponse' :: DisassociateResolverRuleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateResolverRuleResponse
s@DisassociateResolverRuleResponse' {} Int
a -> DisassociateResolverRuleResponse
s {$sel:httpStatus:DisassociateResolverRuleResponse' :: Int
httpStatus = Int
a} :: DisassociateResolverRuleResponse)
instance
Prelude.NFData
DisassociateResolverRuleResponse