{-# 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.AssociateResolverEndpointIpAddress
(
AssociateResolverEndpointIpAddress (..),
newAssociateResolverEndpointIpAddress,
associateResolverEndpointIpAddress_resolverEndpointId,
associateResolverEndpointIpAddress_ipAddress,
AssociateResolverEndpointIpAddressResponse (..),
newAssociateResolverEndpointIpAddressResponse,
associateResolverEndpointIpAddressResponse_resolverEndpoint,
associateResolverEndpointIpAddressResponse_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 AssociateResolverEndpointIpAddress = AssociateResolverEndpointIpAddress'
{
AssociateResolverEndpointIpAddress -> Text
resolverEndpointId :: Prelude.Text,
AssociateResolverEndpointIpAddress -> IpAddressUpdate
ipAddress :: IpAddressUpdate
}
deriving (AssociateResolverEndpointIpAddress
-> AssociateResolverEndpointIpAddress -> Bool
(AssociateResolverEndpointIpAddress
-> AssociateResolverEndpointIpAddress -> Bool)
-> (AssociateResolverEndpointIpAddress
-> AssociateResolverEndpointIpAddress -> Bool)
-> Eq AssociateResolverEndpointIpAddress
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateResolverEndpointIpAddress
-> AssociateResolverEndpointIpAddress -> Bool
$c/= :: AssociateResolverEndpointIpAddress
-> AssociateResolverEndpointIpAddress -> Bool
== :: AssociateResolverEndpointIpAddress
-> AssociateResolverEndpointIpAddress -> Bool
$c== :: AssociateResolverEndpointIpAddress
-> AssociateResolverEndpointIpAddress -> Bool
Prelude.Eq, ReadPrec [AssociateResolverEndpointIpAddress]
ReadPrec AssociateResolverEndpointIpAddress
Int -> ReadS AssociateResolverEndpointIpAddress
ReadS [AssociateResolverEndpointIpAddress]
(Int -> ReadS AssociateResolverEndpointIpAddress)
-> ReadS [AssociateResolverEndpointIpAddress]
-> ReadPrec AssociateResolverEndpointIpAddress
-> ReadPrec [AssociateResolverEndpointIpAddress]
-> Read AssociateResolverEndpointIpAddress
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateResolverEndpointIpAddress]
$creadListPrec :: ReadPrec [AssociateResolverEndpointIpAddress]
readPrec :: ReadPrec AssociateResolverEndpointIpAddress
$creadPrec :: ReadPrec AssociateResolverEndpointIpAddress
readList :: ReadS [AssociateResolverEndpointIpAddress]
$creadList :: ReadS [AssociateResolverEndpointIpAddress]
readsPrec :: Int -> ReadS AssociateResolverEndpointIpAddress
$creadsPrec :: Int -> ReadS AssociateResolverEndpointIpAddress
Prelude.Read, Int -> AssociateResolverEndpointIpAddress -> ShowS
[AssociateResolverEndpointIpAddress] -> ShowS
AssociateResolverEndpointIpAddress -> String
(Int -> AssociateResolverEndpointIpAddress -> ShowS)
-> (AssociateResolverEndpointIpAddress -> String)
-> ([AssociateResolverEndpointIpAddress] -> ShowS)
-> Show AssociateResolverEndpointIpAddress
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateResolverEndpointIpAddress] -> ShowS
$cshowList :: [AssociateResolverEndpointIpAddress] -> ShowS
show :: AssociateResolverEndpointIpAddress -> String
$cshow :: AssociateResolverEndpointIpAddress -> String
showsPrec :: Int -> AssociateResolverEndpointIpAddress -> ShowS
$cshowsPrec :: Int -> AssociateResolverEndpointIpAddress -> ShowS
Prelude.Show, (forall x.
AssociateResolverEndpointIpAddress
-> Rep AssociateResolverEndpointIpAddress x)
-> (forall x.
Rep AssociateResolverEndpointIpAddress x
-> AssociateResolverEndpointIpAddress)
-> Generic AssociateResolverEndpointIpAddress
forall x.
Rep AssociateResolverEndpointIpAddress x
-> AssociateResolverEndpointIpAddress
forall x.
AssociateResolverEndpointIpAddress
-> Rep AssociateResolverEndpointIpAddress x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateResolverEndpointIpAddress x
-> AssociateResolverEndpointIpAddress
$cfrom :: forall x.
AssociateResolverEndpointIpAddress
-> Rep AssociateResolverEndpointIpAddress x
Prelude.Generic)
newAssociateResolverEndpointIpAddress ::
Prelude.Text ->
IpAddressUpdate ->
AssociateResolverEndpointIpAddress
newAssociateResolverEndpointIpAddress :: Text -> IpAddressUpdate -> AssociateResolverEndpointIpAddress
newAssociateResolverEndpointIpAddress
Text
pResolverEndpointId_
IpAddressUpdate
pIpAddress_ =
AssociateResolverEndpointIpAddress' :: Text -> IpAddressUpdate -> AssociateResolverEndpointIpAddress
AssociateResolverEndpointIpAddress'
{ $sel:resolverEndpointId:AssociateResolverEndpointIpAddress' :: Text
resolverEndpointId =
Text
pResolverEndpointId_,
$sel:ipAddress:AssociateResolverEndpointIpAddress' :: IpAddressUpdate
ipAddress = IpAddressUpdate
pIpAddress_
}
associateResolverEndpointIpAddress_resolverEndpointId :: Lens.Lens' AssociateResolverEndpointIpAddress Prelude.Text
associateResolverEndpointIpAddress_resolverEndpointId :: (Text -> f Text)
-> AssociateResolverEndpointIpAddress
-> f AssociateResolverEndpointIpAddress
associateResolverEndpointIpAddress_resolverEndpointId = (AssociateResolverEndpointIpAddress -> Text)
-> (AssociateResolverEndpointIpAddress
-> Text -> AssociateResolverEndpointIpAddress)
-> Lens
AssociateResolverEndpointIpAddress
AssociateResolverEndpointIpAddress
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResolverEndpointIpAddress' {Text
resolverEndpointId :: Text
$sel:resolverEndpointId:AssociateResolverEndpointIpAddress' :: AssociateResolverEndpointIpAddress -> Text
resolverEndpointId} -> Text
resolverEndpointId) (\s :: AssociateResolverEndpointIpAddress
s@AssociateResolverEndpointIpAddress' {} Text
a -> AssociateResolverEndpointIpAddress
s {$sel:resolverEndpointId:AssociateResolverEndpointIpAddress' :: Text
resolverEndpointId = Text
a} :: AssociateResolverEndpointIpAddress)
associateResolverEndpointIpAddress_ipAddress :: Lens.Lens' AssociateResolverEndpointIpAddress IpAddressUpdate
associateResolverEndpointIpAddress_ipAddress :: (IpAddressUpdate -> f IpAddressUpdate)
-> AssociateResolverEndpointIpAddress
-> f AssociateResolverEndpointIpAddress
associateResolverEndpointIpAddress_ipAddress = (AssociateResolverEndpointIpAddress -> IpAddressUpdate)
-> (AssociateResolverEndpointIpAddress
-> IpAddressUpdate -> AssociateResolverEndpointIpAddress)
-> Lens
AssociateResolverEndpointIpAddress
AssociateResolverEndpointIpAddress
IpAddressUpdate
IpAddressUpdate
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResolverEndpointIpAddress' {IpAddressUpdate
ipAddress :: IpAddressUpdate
$sel:ipAddress:AssociateResolverEndpointIpAddress' :: AssociateResolverEndpointIpAddress -> IpAddressUpdate
ipAddress} -> IpAddressUpdate
ipAddress) (\s :: AssociateResolverEndpointIpAddress
s@AssociateResolverEndpointIpAddress' {} IpAddressUpdate
a -> AssociateResolverEndpointIpAddress
s {$sel:ipAddress:AssociateResolverEndpointIpAddress' :: IpAddressUpdate
ipAddress = IpAddressUpdate
a} :: AssociateResolverEndpointIpAddress)
instance
Core.AWSRequest
AssociateResolverEndpointIpAddress
where
type
AWSResponse AssociateResolverEndpointIpAddress =
AssociateResolverEndpointIpAddressResponse
request :: AssociateResolverEndpointIpAddress
-> Request AssociateResolverEndpointIpAddress
request = Service
-> AssociateResolverEndpointIpAddress
-> Request AssociateResolverEndpointIpAddress
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AssociateResolverEndpointIpAddress
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AssociateResolverEndpointIpAddress)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse AssociateResolverEndpointIpAddress))
-> Logger
-> Service
-> Proxy AssociateResolverEndpointIpAddress
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AssociateResolverEndpointIpAddress)))
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 ResolverEndpoint
-> Int -> AssociateResolverEndpointIpAddressResponse
AssociateResolverEndpointIpAddressResponse'
(Maybe ResolverEndpoint
-> Int -> AssociateResolverEndpointIpAddressResponse)
-> Either String (Maybe ResolverEndpoint)
-> Either
String (Int -> AssociateResolverEndpointIpAddressResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ResolverEndpoint)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ResolverEndpoint")
Either String (Int -> AssociateResolverEndpointIpAddressResponse)
-> Either String Int
-> Either String AssociateResolverEndpointIpAddressResponse
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
AssociateResolverEndpointIpAddress
instance
Prelude.NFData
AssociateResolverEndpointIpAddress
instance
Core.ToHeaders
AssociateResolverEndpointIpAddress
where
toHeaders :: AssociateResolverEndpointIpAddress -> ResponseHeaders
toHeaders =
ResponseHeaders
-> AssociateResolverEndpointIpAddress -> 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.AssociateResolverEndpointIpAddress" ::
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
AssociateResolverEndpointIpAddress
where
toJSON :: AssociateResolverEndpointIpAddress -> Value
toJSON AssociateResolverEndpointIpAddress' {Text
IpAddressUpdate
ipAddress :: IpAddressUpdate
resolverEndpointId :: Text
$sel:ipAddress:AssociateResolverEndpointIpAddress' :: AssociateResolverEndpointIpAddress -> IpAddressUpdate
$sel:resolverEndpointId:AssociateResolverEndpointIpAddress' :: AssociateResolverEndpointIpAddress -> 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
"ResolverEndpointId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resolverEndpointId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"IpAddress" Text -> IpAddressUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= IpAddressUpdate
ipAddress)
]
)
instance
Core.ToPath
AssociateResolverEndpointIpAddress
where
toPath :: AssociateResolverEndpointIpAddress -> ByteString
toPath = ByteString -> AssociateResolverEndpointIpAddress -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
AssociateResolverEndpointIpAddress
where
toQuery :: AssociateResolverEndpointIpAddress -> QueryString
toQuery = QueryString -> AssociateResolverEndpointIpAddress -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AssociateResolverEndpointIpAddressResponse = AssociateResolverEndpointIpAddressResponse'
{
AssociateResolverEndpointIpAddressResponse
-> Maybe ResolverEndpoint
resolverEndpoint :: Prelude.Maybe ResolverEndpoint,
AssociateResolverEndpointIpAddressResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateResolverEndpointIpAddressResponse
-> AssociateResolverEndpointIpAddressResponse -> Bool
(AssociateResolverEndpointIpAddressResponse
-> AssociateResolverEndpointIpAddressResponse -> Bool)
-> (AssociateResolverEndpointIpAddressResponse
-> AssociateResolverEndpointIpAddressResponse -> Bool)
-> Eq AssociateResolverEndpointIpAddressResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateResolverEndpointIpAddressResponse
-> AssociateResolverEndpointIpAddressResponse -> Bool
$c/= :: AssociateResolverEndpointIpAddressResponse
-> AssociateResolverEndpointIpAddressResponse -> Bool
== :: AssociateResolverEndpointIpAddressResponse
-> AssociateResolverEndpointIpAddressResponse -> Bool
$c== :: AssociateResolverEndpointIpAddressResponse
-> AssociateResolverEndpointIpAddressResponse -> Bool
Prelude.Eq, ReadPrec [AssociateResolverEndpointIpAddressResponse]
ReadPrec AssociateResolverEndpointIpAddressResponse
Int -> ReadS AssociateResolverEndpointIpAddressResponse
ReadS [AssociateResolverEndpointIpAddressResponse]
(Int -> ReadS AssociateResolverEndpointIpAddressResponse)
-> ReadS [AssociateResolverEndpointIpAddressResponse]
-> ReadPrec AssociateResolverEndpointIpAddressResponse
-> ReadPrec [AssociateResolverEndpointIpAddressResponse]
-> Read AssociateResolverEndpointIpAddressResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateResolverEndpointIpAddressResponse]
$creadListPrec :: ReadPrec [AssociateResolverEndpointIpAddressResponse]
readPrec :: ReadPrec AssociateResolverEndpointIpAddressResponse
$creadPrec :: ReadPrec AssociateResolverEndpointIpAddressResponse
readList :: ReadS [AssociateResolverEndpointIpAddressResponse]
$creadList :: ReadS [AssociateResolverEndpointIpAddressResponse]
readsPrec :: Int -> ReadS AssociateResolverEndpointIpAddressResponse
$creadsPrec :: Int -> ReadS AssociateResolverEndpointIpAddressResponse
Prelude.Read, Int -> AssociateResolverEndpointIpAddressResponse -> ShowS
[AssociateResolverEndpointIpAddressResponse] -> ShowS
AssociateResolverEndpointIpAddressResponse -> String
(Int -> AssociateResolverEndpointIpAddressResponse -> ShowS)
-> (AssociateResolverEndpointIpAddressResponse -> String)
-> ([AssociateResolverEndpointIpAddressResponse] -> ShowS)
-> Show AssociateResolverEndpointIpAddressResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateResolverEndpointIpAddressResponse] -> ShowS
$cshowList :: [AssociateResolverEndpointIpAddressResponse] -> ShowS
show :: AssociateResolverEndpointIpAddressResponse -> String
$cshow :: AssociateResolverEndpointIpAddressResponse -> String
showsPrec :: Int -> AssociateResolverEndpointIpAddressResponse -> ShowS
$cshowsPrec :: Int -> AssociateResolverEndpointIpAddressResponse -> ShowS
Prelude.Show, (forall x.
AssociateResolverEndpointIpAddressResponse
-> Rep AssociateResolverEndpointIpAddressResponse x)
-> (forall x.
Rep AssociateResolverEndpointIpAddressResponse x
-> AssociateResolverEndpointIpAddressResponse)
-> Generic AssociateResolverEndpointIpAddressResponse
forall x.
Rep AssociateResolverEndpointIpAddressResponse x
-> AssociateResolverEndpointIpAddressResponse
forall x.
AssociateResolverEndpointIpAddressResponse
-> Rep AssociateResolverEndpointIpAddressResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateResolverEndpointIpAddressResponse x
-> AssociateResolverEndpointIpAddressResponse
$cfrom :: forall x.
AssociateResolverEndpointIpAddressResponse
-> Rep AssociateResolverEndpointIpAddressResponse x
Prelude.Generic)
newAssociateResolverEndpointIpAddressResponse ::
Prelude.Int ->
AssociateResolverEndpointIpAddressResponse
newAssociateResolverEndpointIpAddressResponse :: Int -> AssociateResolverEndpointIpAddressResponse
newAssociateResolverEndpointIpAddressResponse
Int
pHttpStatus_ =
AssociateResolverEndpointIpAddressResponse' :: Maybe ResolverEndpoint
-> Int -> AssociateResolverEndpointIpAddressResponse
AssociateResolverEndpointIpAddressResponse'
{ $sel:resolverEndpoint:AssociateResolverEndpointIpAddressResponse' :: Maybe ResolverEndpoint
resolverEndpoint =
Maybe ResolverEndpoint
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AssociateResolverEndpointIpAddressResponse' :: Int
httpStatus = Int
pHttpStatus_
}
associateResolverEndpointIpAddressResponse_resolverEndpoint :: Lens.Lens' AssociateResolverEndpointIpAddressResponse (Prelude.Maybe ResolverEndpoint)
associateResolverEndpointIpAddressResponse_resolverEndpoint :: (Maybe ResolverEndpoint -> f (Maybe ResolverEndpoint))
-> AssociateResolverEndpointIpAddressResponse
-> f AssociateResolverEndpointIpAddressResponse
associateResolverEndpointIpAddressResponse_resolverEndpoint = (AssociateResolverEndpointIpAddressResponse
-> Maybe ResolverEndpoint)
-> (AssociateResolverEndpointIpAddressResponse
-> Maybe ResolverEndpoint
-> AssociateResolverEndpointIpAddressResponse)
-> Lens
AssociateResolverEndpointIpAddressResponse
AssociateResolverEndpointIpAddressResponse
(Maybe ResolverEndpoint)
(Maybe ResolverEndpoint)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResolverEndpointIpAddressResponse' {Maybe ResolverEndpoint
resolverEndpoint :: Maybe ResolverEndpoint
$sel:resolverEndpoint:AssociateResolverEndpointIpAddressResponse' :: AssociateResolverEndpointIpAddressResponse
-> Maybe ResolverEndpoint
resolverEndpoint} -> Maybe ResolverEndpoint
resolverEndpoint) (\s :: AssociateResolverEndpointIpAddressResponse
s@AssociateResolverEndpointIpAddressResponse' {} Maybe ResolverEndpoint
a -> AssociateResolverEndpointIpAddressResponse
s {$sel:resolverEndpoint:AssociateResolverEndpointIpAddressResponse' :: Maybe ResolverEndpoint
resolverEndpoint = Maybe ResolverEndpoint
a} :: AssociateResolverEndpointIpAddressResponse)
associateResolverEndpointIpAddressResponse_httpStatus :: Lens.Lens' AssociateResolverEndpointIpAddressResponse Prelude.Int
associateResolverEndpointIpAddressResponse_httpStatus :: (Int -> f Int)
-> AssociateResolverEndpointIpAddressResponse
-> f AssociateResolverEndpointIpAddressResponse
associateResolverEndpointIpAddressResponse_httpStatus = (AssociateResolverEndpointIpAddressResponse -> Int)
-> (AssociateResolverEndpointIpAddressResponse
-> Int -> AssociateResolverEndpointIpAddressResponse)
-> Lens
AssociateResolverEndpointIpAddressResponse
AssociateResolverEndpointIpAddressResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResolverEndpointIpAddressResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateResolverEndpointIpAddressResponse' :: AssociateResolverEndpointIpAddressResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateResolverEndpointIpAddressResponse
s@AssociateResolverEndpointIpAddressResponse' {} Int
a -> AssociateResolverEndpointIpAddressResponse
s {$sel:httpStatus:AssociateResolverEndpointIpAddressResponse' :: Int
httpStatus = Int
a} :: AssociateResolverEndpointIpAddressResponse)
instance
Prelude.NFData
AssociateResolverEndpointIpAddressResponse