{-# 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.SetSubnets
(
SetSubnets (..),
newSetSubnets,
setSubnets_ipAddressType,
setSubnets_subnetMappings,
setSubnets_subnets,
setSubnets_loadBalancerArn,
SetSubnetsResponse (..),
newSetSubnetsResponse,
setSubnetsResponse_availabilityZones,
setSubnetsResponse_ipAddressType,
setSubnetsResponse_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 SetSubnets = SetSubnets'
{
SetSubnets -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType,
SetSubnets -> Maybe [SubnetMapping]
subnetMappings :: Prelude.Maybe [SubnetMapping],
SetSubnets -> Maybe [Text]
subnets :: Prelude.Maybe [Prelude.Text],
SetSubnets -> Text
loadBalancerArn :: Prelude.Text
}
deriving (SetSubnets -> SetSubnets -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetSubnets -> SetSubnets -> Bool
$c/= :: SetSubnets -> SetSubnets -> Bool
== :: SetSubnets -> SetSubnets -> Bool
$c== :: SetSubnets -> SetSubnets -> Bool
Prelude.Eq, ReadPrec [SetSubnets]
ReadPrec SetSubnets
Int -> ReadS SetSubnets
ReadS [SetSubnets]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetSubnets]
$creadListPrec :: ReadPrec [SetSubnets]
readPrec :: ReadPrec SetSubnets
$creadPrec :: ReadPrec SetSubnets
readList :: ReadS [SetSubnets]
$creadList :: ReadS [SetSubnets]
readsPrec :: Int -> ReadS SetSubnets
$creadsPrec :: Int -> ReadS SetSubnets
Prelude.Read, Int -> SetSubnets -> ShowS
[SetSubnets] -> ShowS
SetSubnets -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetSubnets] -> ShowS
$cshowList :: [SetSubnets] -> ShowS
show :: SetSubnets -> String
$cshow :: SetSubnets -> String
showsPrec :: Int -> SetSubnets -> ShowS
$cshowsPrec :: Int -> SetSubnets -> ShowS
Prelude.Show, forall x. Rep SetSubnets x -> SetSubnets
forall x. SetSubnets -> Rep SetSubnets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetSubnets x -> SetSubnets
$cfrom :: forall x. SetSubnets -> Rep SetSubnets x
Prelude.Generic)
newSetSubnets ::
Prelude.Text ->
SetSubnets
newSetSubnets :: Text -> SetSubnets
newSetSubnets Text
pLoadBalancerArn_ =
SetSubnets'
{ $sel:ipAddressType:SetSubnets' :: Maybe IpAddressType
ipAddressType = forall a. Maybe a
Prelude.Nothing,
$sel:subnetMappings:SetSubnets' :: Maybe [SubnetMapping]
subnetMappings = forall a. Maybe a
Prelude.Nothing,
$sel:subnets:SetSubnets' :: Maybe [Text]
subnets = forall a. Maybe a
Prelude.Nothing,
$sel:loadBalancerArn:SetSubnets' :: Text
loadBalancerArn = Text
pLoadBalancerArn_
}
setSubnets_ipAddressType :: Lens.Lens' SetSubnets (Prelude.Maybe IpAddressType)
setSubnets_ipAddressType :: Lens' SetSubnets (Maybe IpAddressType)
setSubnets_ipAddressType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetSubnets' {Maybe IpAddressType
ipAddressType :: Maybe IpAddressType
$sel:ipAddressType:SetSubnets' :: SetSubnets -> Maybe IpAddressType
ipAddressType} -> Maybe IpAddressType
ipAddressType) (\s :: SetSubnets
s@SetSubnets' {} Maybe IpAddressType
a -> SetSubnets
s {$sel:ipAddressType:SetSubnets' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
a} :: SetSubnets)
setSubnets_subnetMappings :: Lens.Lens' SetSubnets (Prelude.Maybe [SubnetMapping])
setSubnets_subnetMappings :: Lens' SetSubnets (Maybe [SubnetMapping])
setSubnets_subnetMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetSubnets' {Maybe [SubnetMapping]
subnetMappings :: Maybe [SubnetMapping]
$sel:subnetMappings:SetSubnets' :: SetSubnets -> Maybe [SubnetMapping]
subnetMappings} -> Maybe [SubnetMapping]
subnetMappings) (\s :: SetSubnets
s@SetSubnets' {} Maybe [SubnetMapping]
a -> SetSubnets
s {$sel:subnetMappings:SetSubnets' :: Maybe [SubnetMapping]
subnetMappings = Maybe [SubnetMapping]
a} :: SetSubnets) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
setSubnets_subnets :: Lens.Lens' SetSubnets (Prelude.Maybe [Prelude.Text])
setSubnets_subnets :: Lens' SetSubnets (Maybe [Text])
setSubnets_subnets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetSubnets' {Maybe [Text]
subnets :: Maybe [Text]
$sel:subnets:SetSubnets' :: SetSubnets -> Maybe [Text]
subnets} -> Maybe [Text]
subnets) (\s :: SetSubnets
s@SetSubnets' {} Maybe [Text]
a -> SetSubnets
s {$sel:subnets:SetSubnets' :: Maybe [Text]
subnets = Maybe [Text]
a} :: SetSubnets) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
setSubnets_loadBalancerArn :: Lens.Lens' SetSubnets Prelude.Text
setSubnets_loadBalancerArn :: Lens' SetSubnets Text
setSubnets_loadBalancerArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetSubnets' {Text
loadBalancerArn :: Text
$sel:loadBalancerArn:SetSubnets' :: SetSubnets -> Text
loadBalancerArn} -> Text
loadBalancerArn) (\s :: SetSubnets
s@SetSubnets' {} Text
a -> SetSubnets
s {$sel:loadBalancerArn:SetSubnets' :: Text
loadBalancerArn = Text
a} :: SetSubnets)
instance Core.AWSRequest SetSubnets where
type AWSResponse SetSubnets = SetSubnetsResponse
request :: (Service -> Service) -> SetSubnets -> Request SetSubnets
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 SetSubnets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SetSubnets)))
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
"SetSubnetsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe [AvailabilityZone]
-> Maybe IpAddressType -> Int -> SetSubnetsResponse
SetSubnetsResponse'
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
"AvailabilityZones"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
forall (f :: * -> *) a b. Applicative f => 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 SetSubnets where
hashWithSalt :: Int -> SetSubnets -> Int
hashWithSalt Int
_salt SetSubnets' {Maybe [Text]
Maybe [SubnetMapping]
Maybe IpAddressType
Text
loadBalancerArn :: Text
subnets :: Maybe [Text]
subnetMappings :: Maybe [SubnetMapping]
ipAddressType :: Maybe IpAddressType
$sel:loadBalancerArn:SetSubnets' :: SetSubnets -> Text
$sel:subnets:SetSubnets' :: SetSubnets -> Maybe [Text]
$sel:subnetMappings:SetSubnets' :: SetSubnets -> Maybe [SubnetMapping]
$sel:ipAddressType:SetSubnets' :: SetSubnets -> Maybe IpAddressType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IpAddressType
ipAddressType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SubnetMapping]
subnetMappings
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
subnets
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
loadBalancerArn
instance Prelude.NFData SetSubnets where
rnf :: SetSubnets -> ()
rnf SetSubnets' {Maybe [Text]
Maybe [SubnetMapping]
Maybe IpAddressType
Text
loadBalancerArn :: Text
subnets :: Maybe [Text]
subnetMappings :: Maybe [SubnetMapping]
ipAddressType :: Maybe IpAddressType
$sel:loadBalancerArn:SetSubnets' :: SetSubnets -> Text
$sel:subnets:SetSubnets' :: SetSubnets -> Maybe [Text]
$sel:subnetMappings:SetSubnets' :: SetSubnets -> Maybe [SubnetMapping]
$sel:ipAddressType:SetSubnets' :: SetSubnets -> 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 Maybe [SubnetMapping]
subnetMappings
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
subnets
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
loadBalancerArn
instance Data.ToHeaders SetSubnets where
toHeaders :: SetSubnets -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath SetSubnets where
toPath :: SetSubnets -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery SetSubnets where
toQuery :: SetSubnets -> QueryString
toQuery SetSubnets' {Maybe [Text]
Maybe [SubnetMapping]
Maybe IpAddressType
Text
loadBalancerArn :: Text
subnets :: Maybe [Text]
subnetMappings :: Maybe [SubnetMapping]
ipAddressType :: Maybe IpAddressType
$sel:loadBalancerArn:SetSubnets' :: SetSubnets -> Text
$sel:subnets:SetSubnets' :: SetSubnets -> Maybe [Text]
$sel:subnetMappings:SetSubnets' :: SetSubnets -> Maybe [SubnetMapping]
$sel:ipAddressType:SetSubnets' :: SetSubnets -> Maybe IpAddressType
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"SetSubnets" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2015-12-01" :: Prelude.ByteString),
ByteString
"IpAddressType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe IpAddressType
ipAddressType,
ByteString
"SubnetMappings"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SubnetMapping]
subnetMappings
),
ByteString
"Subnets"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
(forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
subnets),
ByteString
"LoadBalancerArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
loadBalancerArn
]
data SetSubnetsResponse = SetSubnetsResponse'
{
SetSubnetsResponse -> Maybe [AvailabilityZone]
availabilityZones :: Prelude.Maybe [AvailabilityZone],
SetSubnetsResponse -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType,
SetSubnetsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SetSubnetsResponse -> SetSubnetsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetSubnetsResponse -> SetSubnetsResponse -> Bool
$c/= :: SetSubnetsResponse -> SetSubnetsResponse -> Bool
== :: SetSubnetsResponse -> SetSubnetsResponse -> Bool
$c== :: SetSubnetsResponse -> SetSubnetsResponse -> Bool
Prelude.Eq, ReadPrec [SetSubnetsResponse]
ReadPrec SetSubnetsResponse
Int -> ReadS SetSubnetsResponse
ReadS [SetSubnetsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetSubnetsResponse]
$creadListPrec :: ReadPrec [SetSubnetsResponse]
readPrec :: ReadPrec SetSubnetsResponse
$creadPrec :: ReadPrec SetSubnetsResponse
readList :: ReadS [SetSubnetsResponse]
$creadList :: ReadS [SetSubnetsResponse]
readsPrec :: Int -> ReadS SetSubnetsResponse
$creadsPrec :: Int -> ReadS SetSubnetsResponse
Prelude.Read, Int -> SetSubnetsResponse -> ShowS
[SetSubnetsResponse] -> ShowS
SetSubnetsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetSubnetsResponse] -> ShowS
$cshowList :: [SetSubnetsResponse] -> ShowS
show :: SetSubnetsResponse -> String
$cshow :: SetSubnetsResponse -> String
showsPrec :: Int -> SetSubnetsResponse -> ShowS
$cshowsPrec :: Int -> SetSubnetsResponse -> ShowS
Prelude.Show, forall x. Rep SetSubnetsResponse x -> SetSubnetsResponse
forall x. SetSubnetsResponse -> Rep SetSubnetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetSubnetsResponse x -> SetSubnetsResponse
$cfrom :: forall x. SetSubnetsResponse -> Rep SetSubnetsResponse x
Prelude.Generic)
newSetSubnetsResponse ::
Prelude.Int ->
SetSubnetsResponse
newSetSubnetsResponse :: Int -> SetSubnetsResponse
newSetSubnetsResponse Int
pHttpStatus_ =
SetSubnetsResponse'
{ $sel:availabilityZones:SetSubnetsResponse' :: Maybe [AvailabilityZone]
availabilityZones =
forall a. Maybe a
Prelude.Nothing,
$sel:ipAddressType:SetSubnetsResponse' :: Maybe IpAddressType
ipAddressType = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SetSubnetsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
setSubnetsResponse_availabilityZones :: Lens.Lens' SetSubnetsResponse (Prelude.Maybe [AvailabilityZone])
setSubnetsResponse_availabilityZones :: Lens' SetSubnetsResponse (Maybe [AvailabilityZone])
setSubnetsResponse_availabilityZones = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetSubnetsResponse' {Maybe [AvailabilityZone]
availabilityZones :: Maybe [AvailabilityZone]
$sel:availabilityZones:SetSubnetsResponse' :: SetSubnetsResponse -> Maybe [AvailabilityZone]
availabilityZones} -> Maybe [AvailabilityZone]
availabilityZones) (\s :: SetSubnetsResponse
s@SetSubnetsResponse' {} Maybe [AvailabilityZone]
a -> SetSubnetsResponse
s {$sel:availabilityZones:SetSubnetsResponse' :: Maybe [AvailabilityZone]
availabilityZones = Maybe [AvailabilityZone]
a} :: SetSubnetsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
setSubnetsResponse_ipAddressType :: Lens.Lens' SetSubnetsResponse (Prelude.Maybe IpAddressType)
setSubnetsResponse_ipAddressType :: Lens' SetSubnetsResponse (Maybe IpAddressType)
setSubnetsResponse_ipAddressType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetSubnetsResponse' {Maybe IpAddressType
ipAddressType :: Maybe IpAddressType
$sel:ipAddressType:SetSubnetsResponse' :: SetSubnetsResponse -> Maybe IpAddressType
ipAddressType} -> Maybe IpAddressType
ipAddressType) (\s :: SetSubnetsResponse
s@SetSubnetsResponse' {} Maybe IpAddressType
a -> SetSubnetsResponse
s {$sel:ipAddressType:SetSubnetsResponse' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
a} :: SetSubnetsResponse)
setSubnetsResponse_httpStatus :: Lens.Lens' SetSubnetsResponse Prelude.Int
setSubnetsResponse_httpStatus :: Lens' SetSubnetsResponse Int
setSubnetsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetSubnetsResponse' {Int
httpStatus :: Int
$sel:httpStatus:SetSubnetsResponse' :: SetSubnetsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SetSubnetsResponse
s@SetSubnetsResponse' {} Int
a -> SetSubnetsResponse
s {$sel:httpStatus:SetSubnetsResponse' :: Int
httpStatus = Int
a} :: SetSubnetsResponse)
instance Prelude.NFData SetSubnetsResponse where
rnf :: SetSubnetsResponse -> ()
rnf SetSubnetsResponse' {Int
Maybe [AvailabilityZone]
Maybe IpAddressType
httpStatus :: Int
ipAddressType :: Maybe IpAddressType
availabilityZones :: Maybe [AvailabilityZone]
$sel:httpStatus:SetSubnetsResponse' :: SetSubnetsResponse -> Int
$sel:ipAddressType:SetSubnetsResponse' :: SetSubnetsResponse -> Maybe IpAddressType
$sel:availabilityZones:SetSubnetsResponse' :: SetSubnetsResponse -> Maybe [AvailabilityZone]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AvailabilityZone]
availabilityZones
seq :: forall a b. a -> b -> b
`Prelude.seq` 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