{-# 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.ELBV2.SetIpAddressType
(
SetIpAddressType (..),
newSetIpAddressType,
setIpAddressType_loadBalancerArn,
setIpAddressType_ipAddressType,
SetIpAddressTypeResponse (..),
newSetIpAddressTypeResponse,
setIpAddressTypeResponse_ipAddressType,
setIpAddressTypeResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ELBV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data SetIpAddressType = SetIpAddressType'
{
SetIpAddressType -> Text
loadBalancerArn :: Prelude.Text,
SetIpAddressType -> IpAddressType
ipAddressType :: IpAddressType
}
deriving (SetIpAddressType -> SetIpAddressType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetIpAddressType -> SetIpAddressType -> Bool
$c/= :: SetIpAddressType -> SetIpAddressType -> Bool
== :: SetIpAddressType -> SetIpAddressType -> Bool
$c== :: SetIpAddressType -> SetIpAddressType -> Bool
Prelude.Eq, ReadPrec [SetIpAddressType]
ReadPrec SetIpAddressType
Int -> ReadS SetIpAddressType
ReadS [SetIpAddressType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetIpAddressType]
$creadListPrec :: ReadPrec [SetIpAddressType]
readPrec :: ReadPrec SetIpAddressType
$creadPrec :: ReadPrec SetIpAddressType
readList :: ReadS [SetIpAddressType]
$creadList :: ReadS [SetIpAddressType]
readsPrec :: Int -> ReadS SetIpAddressType
$creadsPrec :: Int -> ReadS SetIpAddressType
Prelude.Read, Int -> SetIpAddressType -> ShowS
[SetIpAddressType] -> ShowS
SetIpAddressType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetIpAddressType] -> ShowS
$cshowList :: [SetIpAddressType] -> ShowS
show :: SetIpAddressType -> String
$cshow :: SetIpAddressType -> String
showsPrec :: Int -> SetIpAddressType -> ShowS
$cshowsPrec :: Int -> SetIpAddressType -> ShowS
Prelude.Show, forall x. Rep SetIpAddressType x -> SetIpAddressType
forall x. SetIpAddressType -> Rep SetIpAddressType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetIpAddressType x -> SetIpAddressType
$cfrom :: forall x. SetIpAddressType -> Rep SetIpAddressType x
Prelude.Generic)
newSetIpAddressType ::
Prelude.Text ->
IpAddressType ->
SetIpAddressType
newSetIpAddressType :: Text -> IpAddressType -> SetIpAddressType
newSetIpAddressType Text
pLoadBalancerArn_ IpAddressType
pIpAddressType_ =
SetIpAddressType'
{ $sel:loadBalancerArn:SetIpAddressType' :: Text
loadBalancerArn =
Text
pLoadBalancerArn_,
$sel:ipAddressType:SetIpAddressType' :: IpAddressType
ipAddressType = IpAddressType
pIpAddressType_
}
setIpAddressType_loadBalancerArn :: Lens.Lens' SetIpAddressType Prelude.Text
setIpAddressType_loadBalancerArn :: Lens' SetIpAddressType Text
setIpAddressType_loadBalancerArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetIpAddressType' {Text
loadBalancerArn :: Text
$sel:loadBalancerArn:SetIpAddressType' :: SetIpAddressType -> Text
loadBalancerArn} -> Text
loadBalancerArn) (\s :: SetIpAddressType
s@SetIpAddressType' {} Text
a -> SetIpAddressType
s {$sel:loadBalancerArn:SetIpAddressType' :: Text
loadBalancerArn = Text
a} :: SetIpAddressType)
setIpAddressType_ipAddressType :: Lens.Lens' SetIpAddressType IpAddressType
setIpAddressType_ipAddressType :: Lens' SetIpAddressType IpAddressType
setIpAddressType_ipAddressType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetIpAddressType' {IpAddressType
ipAddressType :: IpAddressType
$sel:ipAddressType:SetIpAddressType' :: SetIpAddressType -> IpAddressType
ipAddressType} -> IpAddressType
ipAddressType) (\s :: SetIpAddressType
s@SetIpAddressType' {} IpAddressType
a -> SetIpAddressType
s {$sel:ipAddressType:SetIpAddressType' :: IpAddressType
ipAddressType = IpAddressType
a} :: SetIpAddressType)
instance Core.AWSRequest SetIpAddressType where
type
AWSResponse SetIpAddressType =
SetIpAddressTypeResponse
request :: (Service -> Service)
-> SetIpAddressType -> Request SetIpAddressType
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy SetIpAddressType
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SetIpAddressType)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"SetIpAddressTypeResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe IpAddressType -> Int -> SetIpAddressTypeResponse
SetIpAddressTypeResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"IpAddressType")
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 SetIpAddressType where
hashWithSalt :: Int -> SetIpAddressType -> Int
hashWithSalt Int
_salt SetIpAddressType' {Text
IpAddressType
ipAddressType :: IpAddressType
loadBalancerArn :: Text
$sel:ipAddressType:SetIpAddressType' :: SetIpAddressType -> IpAddressType
$sel:loadBalancerArn:SetIpAddressType' :: SetIpAddressType -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
loadBalancerArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` IpAddressType
ipAddressType
instance Prelude.NFData SetIpAddressType where
rnf :: SetIpAddressType -> ()
rnf SetIpAddressType' {Text
IpAddressType
ipAddressType :: IpAddressType
loadBalancerArn :: Text
$sel:ipAddressType:SetIpAddressType' :: SetIpAddressType -> IpAddressType
$sel:loadBalancerArn:SetIpAddressType' :: SetIpAddressType -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
loadBalancerArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf IpAddressType
ipAddressType
instance Data.ToHeaders SetIpAddressType where
toHeaders :: SetIpAddressType -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath SetIpAddressType where
toPath :: SetIpAddressType -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery SetIpAddressType where
toQuery :: SetIpAddressType -> QueryString
toQuery SetIpAddressType' {Text
IpAddressType
ipAddressType :: IpAddressType
loadBalancerArn :: Text
$sel:ipAddressType:SetIpAddressType' :: SetIpAddressType -> IpAddressType
$sel:loadBalancerArn:SetIpAddressType' :: SetIpAddressType -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"SetIpAddressType" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2015-12-01" :: Prelude.ByteString),
ByteString
"LoadBalancerArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
loadBalancerArn,
ByteString
"IpAddressType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: IpAddressType
ipAddressType
]
data SetIpAddressTypeResponse = SetIpAddressTypeResponse'
{
SetIpAddressTypeResponse -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType,
SetIpAddressTypeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SetIpAddressTypeResponse -> SetIpAddressTypeResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetIpAddressTypeResponse -> SetIpAddressTypeResponse -> Bool
$c/= :: SetIpAddressTypeResponse -> SetIpAddressTypeResponse -> Bool
== :: SetIpAddressTypeResponse -> SetIpAddressTypeResponse -> Bool
$c== :: SetIpAddressTypeResponse -> SetIpAddressTypeResponse -> Bool
Prelude.Eq, ReadPrec [SetIpAddressTypeResponse]
ReadPrec SetIpAddressTypeResponse
Int -> ReadS SetIpAddressTypeResponse
ReadS [SetIpAddressTypeResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetIpAddressTypeResponse]
$creadListPrec :: ReadPrec [SetIpAddressTypeResponse]
readPrec :: ReadPrec SetIpAddressTypeResponse
$creadPrec :: ReadPrec SetIpAddressTypeResponse
readList :: ReadS [SetIpAddressTypeResponse]
$creadList :: ReadS [SetIpAddressTypeResponse]
readsPrec :: Int -> ReadS SetIpAddressTypeResponse
$creadsPrec :: Int -> ReadS SetIpAddressTypeResponse
Prelude.Read, Int -> SetIpAddressTypeResponse -> ShowS
[SetIpAddressTypeResponse] -> ShowS
SetIpAddressTypeResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetIpAddressTypeResponse] -> ShowS
$cshowList :: [SetIpAddressTypeResponse] -> ShowS
show :: SetIpAddressTypeResponse -> String
$cshow :: SetIpAddressTypeResponse -> String
showsPrec :: Int -> SetIpAddressTypeResponse -> ShowS
$cshowsPrec :: Int -> SetIpAddressTypeResponse -> ShowS
Prelude.Show, forall x.
Rep SetIpAddressTypeResponse x -> SetIpAddressTypeResponse
forall x.
SetIpAddressTypeResponse -> Rep SetIpAddressTypeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetIpAddressTypeResponse x -> SetIpAddressTypeResponse
$cfrom :: forall x.
SetIpAddressTypeResponse -> Rep SetIpAddressTypeResponse x
Prelude.Generic)
newSetIpAddressTypeResponse ::
Prelude.Int ->
SetIpAddressTypeResponse
newSetIpAddressTypeResponse :: Int -> SetIpAddressTypeResponse
newSetIpAddressTypeResponse Int
pHttpStatus_ =
SetIpAddressTypeResponse'
{ $sel:ipAddressType:SetIpAddressTypeResponse' :: Maybe IpAddressType
ipAddressType =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SetIpAddressTypeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
setIpAddressTypeResponse_ipAddressType :: Lens.Lens' SetIpAddressTypeResponse (Prelude.Maybe IpAddressType)
setIpAddressTypeResponse_ipAddressType :: Lens' SetIpAddressTypeResponse (Maybe IpAddressType)
setIpAddressTypeResponse_ipAddressType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetIpAddressTypeResponse' {Maybe IpAddressType
ipAddressType :: Maybe IpAddressType
$sel:ipAddressType:SetIpAddressTypeResponse' :: SetIpAddressTypeResponse -> Maybe IpAddressType
ipAddressType} -> Maybe IpAddressType
ipAddressType) (\s :: SetIpAddressTypeResponse
s@SetIpAddressTypeResponse' {} Maybe IpAddressType
a -> SetIpAddressTypeResponse
s {$sel:ipAddressType:SetIpAddressTypeResponse' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
a} :: SetIpAddressTypeResponse)
setIpAddressTypeResponse_httpStatus :: Lens.Lens' SetIpAddressTypeResponse Prelude.Int
setIpAddressTypeResponse_httpStatus :: Lens' SetIpAddressTypeResponse Int
setIpAddressTypeResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetIpAddressTypeResponse' {Int
httpStatus :: Int
$sel:httpStatus:SetIpAddressTypeResponse' :: SetIpAddressTypeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SetIpAddressTypeResponse
s@SetIpAddressTypeResponse' {} Int
a -> SetIpAddressTypeResponse
s {$sel:httpStatus:SetIpAddressTypeResponse' :: Int
httpStatus = Int
a} :: SetIpAddressTypeResponse)
instance Prelude.NFData SetIpAddressTypeResponse where
rnf :: SetIpAddressTypeResponse -> ()
rnf SetIpAddressTypeResponse' {Int
Maybe IpAddressType
httpStatus :: Int
ipAddressType :: Maybe IpAddressType
$sel:httpStatus:SetIpAddressTypeResponse' :: SetIpAddressTypeResponse -> Int
$sel:ipAddressType:SetIpAddressTypeResponse' :: SetIpAddressTypeResponse -> Maybe IpAddressType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe IpAddressType
ipAddressType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus