{-# 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.ELB.CreateLBCookieStickinessPolicy
(
CreateLBCookieStickinessPolicy (..),
newCreateLBCookieStickinessPolicy,
createLBCookieStickinessPolicy_cookieExpirationPeriod,
createLBCookieStickinessPolicy_loadBalancerName,
createLBCookieStickinessPolicy_policyName,
CreateLBCookieStickinessPolicyResponse (..),
newCreateLBCookieStickinessPolicyResponse,
createLBCookieStickinessPolicyResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ELB.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateLBCookieStickinessPolicy = CreateLBCookieStickinessPolicy'
{
CreateLBCookieStickinessPolicy -> Maybe Integer
cookieExpirationPeriod :: Prelude.Maybe Prelude.Integer,
CreateLBCookieStickinessPolicy -> Text
loadBalancerName :: Prelude.Text,
CreateLBCookieStickinessPolicy -> Text
policyName :: Prelude.Text
}
deriving (CreateLBCookieStickinessPolicy
-> CreateLBCookieStickinessPolicy -> Bool
(CreateLBCookieStickinessPolicy
-> CreateLBCookieStickinessPolicy -> Bool)
-> (CreateLBCookieStickinessPolicy
-> CreateLBCookieStickinessPolicy -> Bool)
-> Eq CreateLBCookieStickinessPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLBCookieStickinessPolicy
-> CreateLBCookieStickinessPolicy -> Bool
$c/= :: CreateLBCookieStickinessPolicy
-> CreateLBCookieStickinessPolicy -> Bool
== :: CreateLBCookieStickinessPolicy
-> CreateLBCookieStickinessPolicy -> Bool
$c== :: CreateLBCookieStickinessPolicy
-> CreateLBCookieStickinessPolicy -> Bool
Prelude.Eq, ReadPrec [CreateLBCookieStickinessPolicy]
ReadPrec CreateLBCookieStickinessPolicy
Int -> ReadS CreateLBCookieStickinessPolicy
ReadS [CreateLBCookieStickinessPolicy]
(Int -> ReadS CreateLBCookieStickinessPolicy)
-> ReadS [CreateLBCookieStickinessPolicy]
-> ReadPrec CreateLBCookieStickinessPolicy
-> ReadPrec [CreateLBCookieStickinessPolicy]
-> Read CreateLBCookieStickinessPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLBCookieStickinessPolicy]
$creadListPrec :: ReadPrec [CreateLBCookieStickinessPolicy]
readPrec :: ReadPrec CreateLBCookieStickinessPolicy
$creadPrec :: ReadPrec CreateLBCookieStickinessPolicy
readList :: ReadS [CreateLBCookieStickinessPolicy]
$creadList :: ReadS [CreateLBCookieStickinessPolicy]
readsPrec :: Int -> ReadS CreateLBCookieStickinessPolicy
$creadsPrec :: Int -> ReadS CreateLBCookieStickinessPolicy
Prelude.Read, Int -> CreateLBCookieStickinessPolicy -> ShowS
[CreateLBCookieStickinessPolicy] -> ShowS
CreateLBCookieStickinessPolicy -> String
(Int -> CreateLBCookieStickinessPolicy -> ShowS)
-> (CreateLBCookieStickinessPolicy -> String)
-> ([CreateLBCookieStickinessPolicy] -> ShowS)
-> Show CreateLBCookieStickinessPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLBCookieStickinessPolicy] -> ShowS
$cshowList :: [CreateLBCookieStickinessPolicy] -> ShowS
show :: CreateLBCookieStickinessPolicy -> String
$cshow :: CreateLBCookieStickinessPolicy -> String
showsPrec :: Int -> CreateLBCookieStickinessPolicy -> ShowS
$cshowsPrec :: Int -> CreateLBCookieStickinessPolicy -> ShowS
Prelude.Show, (forall x.
CreateLBCookieStickinessPolicy
-> Rep CreateLBCookieStickinessPolicy x)
-> (forall x.
Rep CreateLBCookieStickinessPolicy x
-> CreateLBCookieStickinessPolicy)
-> Generic CreateLBCookieStickinessPolicy
forall x.
Rep CreateLBCookieStickinessPolicy x
-> CreateLBCookieStickinessPolicy
forall x.
CreateLBCookieStickinessPolicy
-> Rep CreateLBCookieStickinessPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLBCookieStickinessPolicy x
-> CreateLBCookieStickinessPolicy
$cfrom :: forall x.
CreateLBCookieStickinessPolicy
-> Rep CreateLBCookieStickinessPolicy x
Prelude.Generic)
newCreateLBCookieStickinessPolicy ::
Prelude.Text ->
Prelude.Text ->
CreateLBCookieStickinessPolicy
newCreateLBCookieStickinessPolicy :: Text -> Text -> CreateLBCookieStickinessPolicy
newCreateLBCookieStickinessPolicy
Text
pLoadBalancerName_
Text
pPolicyName_ =
CreateLBCookieStickinessPolicy' :: Maybe Integer -> Text -> Text -> CreateLBCookieStickinessPolicy
CreateLBCookieStickinessPolicy'
{ $sel:cookieExpirationPeriod:CreateLBCookieStickinessPolicy' :: Maybe Integer
cookieExpirationPeriod =
Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:loadBalancerName:CreateLBCookieStickinessPolicy' :: Text
loadBalancerName = Text
pLoadBalancerName_,
$sel:policyName:CreateLBCookieStickinessPolicy' :: Text
policyName = Text
pPolicyName_
}
createLBCookieStickinessPolicy_cookieExpirationPeriod :: Lens.Lens' CreateLBCookieStickinessPolicy (Prelude.Maybe Prelude.Integer)
createLBCookieStickinessPolicy_cookieExpirationPeriod :: (Maybe Integer -> f (Maybe Integer))
-> CreateLBCookieStickinessPolicy
-> f CreateLBCookieStickinessPolicy
createLBCookieStickinessPolicy_cookieExpirationPeriod = (CreateLBCookieStickinessPolicy -> Maybe Integer)
-> (CreateLBCookieStickinessPolicy
-> Maybe Integer -> CreateLBCookieStickinessPolicy)
-> Lens
CreateLBCookieStickinessPolicy
CreateLBCookieStickinessPolicy
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLBCookieStickinessPolicy' {Maybe Integer
cookieExpirationPeriod :: Maybe Integer
$sel:cookieExpirationPeriod:CreateLBCookieStickinessPolicy' :: CreateLBCookieStickinessPolicy -> Maybe Integer
cookieExpirationPeriod} -> Maybe Integer
cookieExpirationPeriod) (\s :: CreateLBCookieStickinessPolicy
s@CreateLBCookieStickinessPolicy' {} Maybe Integer
a -> CreateLBCookieStickinessPolicy
s {$sel:cookieExpirationPeriod:CreateLBCookieStickinessPolicy' :: Maybe Integer
cookieExpirationPeriod = Maybe Integer
a} :: CreateLBCookieStickinessPolicy)
createLBCookieStickinessPolicy_loadBalancerName :: Lens.Lens' CreateLBCookieStickinessPolicy Prelude.Text
createLBCookieStickinessPolicy_loadBalancerName :: (Text -> f Text)
-> CreateLBCookieStickinessPolicy
-> f CreateLBCookieStickinessPolicy
createLBCookieStickinessPolicy_loadBalancerName = (CreateLBCookieStickinessPolicy -> Text)
-> (CreateLBCookieStickinessPolicy
-> Text -> CreateLBCookieStickinessPolicy)
-> Lens
CreateLBCookieStickinessPolicy
CreateLBCookieStickinessPolicy
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLBCookieStickinessPolicy' {Text
loadBalancerName :: Text
$sel:loadBalancerName:CreateLBCookieStickinessPolicy' :: CreateLBCookieStickinessPolicy -> Text
loadBalancerName} -> Text
loadBalancerName) (\s :: CreateLBCookieStickinessPolicy
s@CreateLBCookieStickinessPolicy' {} Text
a -> CreateLBCookieStickinessPolicy
s {$sel:loadBalancerName:CreateLBCookieStickinessPolicy' :: Text
loadBalancerName = Text
a} :: CreateLBCookieStickinessPolicy)
createLBCookieStickinessPolicy_policyName :: Lens.Lens' CreateLBCookieStickinessPolicy Prelude.Text
createLBCookieStickinessPolicy_policyName :: (Text -> f Text)
-> CreateLBCookieStickinessPolicy
-> f CreateLBCookieStickinessPolicy
createLBCookieStickinessPolicy_policyName = (CreateLBCookieStickinessPolicy -> Text)
-> (CreateLBCookieStickinessPolicy
-> Text -> CreateLBCookieStickinessPolicy)
-> Lens
CreateLBCookieStickinessPolicy
CreateLBCookieStickinessPolicy
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLBCookieStickinessPolicy' {Text
policyName :: Text
$sel:policyName:CreateLBCookieStickinessPolicy' :: CreateLBCookieStickinessPolicy -> Text
policyName} -> Text
policyName) (\s :: CreateLBCookieStickinessPolicy
s@CreateLBCookieStickinessPolicy' {} Text
a -> CreateLBCookieStickinessPolicy
s {$sel:policyName:CreateLBCookieStickinessPolicy' :: Text
policyName = Text
a} :: CreateLBCookieStickinessPolicy)
instance
Core.AWSRequest
CreateLBCookieStickinessPolicy
where
type
AWSResponse CreateLBCookieStickinessPolicy =
CreateLBCookieStickinessPolicyResponse
request :: CreateLBCookieStickinessPolicy
-> Request CreateLBCookieStickinessPolicy
request = Service
-> CreateLBCookieStickinessPolicy
-> Request CreateLBCookieStickinessPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CreateLBCookieStickinessPolicy
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CreateLBCookieStickinessPolicy)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CreateLBCookieStickinessPolicy))
-> Logger
-> Service
-> Proxy CreateLBCookieStickinessPolicy
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CreateLBCookieStickinessPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"CreateLBCookieStickinessPolicyResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> CreateLBCookieStickinessPolicyResponse
CreateLBCookieStickinessPolicyResponse'
(Int -> CreateLBCookieStickinessPolicyResponse)
-> Either String Int
-> Either String CreateLBCookieStickinessPolicyResponse
forall (f :: * -> *) a b. Functor 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
CreateLBCookieStickinessPolicy
instance
Prelude.NFData
CreateLBCookieStickinessPolicy
instance
Core.ToHeaders
CreateLBCookieStickinessPolicy
where
toHeaders :: CreateLBCookieStickinessPolicy -> ResponseHeaders
toHeaders = ResponseHeaders
-> CreateLBCookieStickinessPolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CreateLBCookieStickinessPolicy where
toPath :: CreateLBCookieStickinessPolicy -> ByteString
toPath = ByteString -> CreateLBCookieStickinessPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateLBCookieStickinessPolicy where
toQuery :: CreateLBCookieStickinessPolicy -> QueryString
toQuery CreateLBCookieStickinessPolicy' {Maybe Integer
Text
policyName :: Text
loadBalancerName :: Text
cookieExpirationPeriod :: Maybe Integer
$sel:policyName:CreateLBCookieStickinessPolicy' :: CreateLBCookieStickinessPolicy -> Text
$sel:loadBalancerName:CreateLBCookieStickinessPolicy' :: CreateLBCookieStickinessPolicy -> Text
$sel:cookieExpirationPeriod:CreateLBCookieStickinessPolicy' :: CreateLBCookieStickinessPolicy -> Maybe Integer
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"CreateLBCookieStickinessPolicy" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-06-01" :: Prelude.ByteString),
ByteString
"CookieExpirationPeriod"
ByteString -> Maybe Integer -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Integer
cookieExpirationPeriod,
ByteString
"LoadBalancerName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
loadBalancerName,
ByteString
"PolicyName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
policyName
]
data CreateLBCookieStickinessPolicyResponse = CreateLBCookieStickinessPolicyResponse'
{
CreateLBCookieStickinessPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateLBCookieStickinessPolicyResponse
-> CreateLBCookieStickinessPolicyResponse -> Bool
(CreateLBCookieStickinessPolicyResponse
-> CreateLBCookieStickinessPolicyResponse -> Bool)
-> (CreateLBCookieStickinessPolicyResponse
-> CreateLBCookieStickinessPolicyResponse -> Bool)
-> Eq CreateLBCookieStickinessPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLBCookieStickinessPolicyResponse
-> CreateLBCookieStickinessPolicyResponse -> Bool
$c/= :: CreateLBCookieStickinessPolicyResponse
-> CreateLBCookieStickinessPolicyResponse -> Bool
== :: CreateLBCookieStickinessPolicyResponse
-> CreateLBCookieStickinessPolicyResponse -> Bool
$c== :: CreateLBCookieStickinessPolicyResponse
-> CreateLBCookieStickinessPolicyResponse -> Bool
Prelude.Eq, ReadPrec [CreateLBCookieStickinessPolicyResponse]
ReadPrec CreateLBCookieStickinessPolicyResponse
Int -> ReadS CreateLBCookieStickinessPolicyResponse
ReadS [CreateLBCookieStickinessPolicyResponse]
(Int -> ReadS CreateLBCookieStickinessPolicyResponse)
-> ReadS [CreateLBCookieStickinessPolicyResponse]
-> ReadPrec CreateLBCookieStickinessPolicyResponse
-> ReadPrec [CreateLBCookieStickinessPolicyResponse]
-> Read CreateLBCookieStickinessPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLBCookieStickinessPolicyResponse]
$creadListPrec :: ReadPrec [CreateLBCookieStickinessPolicyResponse]
readPrec :: ReadPrec CreateLBCookieStickinessPolicyResponse
$creadPrec :: ReadPrec CreateLBCookieStickinessPolicyResponse
readList :: ReadS [CreateLBCookieStickinessPolicyResponse]
$creadList :: ReadS [CreateLBCookieStickinessPolicyResponse]
readsPrec :: Int -> ReadS CreateLBCookieStickinessPolicyResponse
$creadsPrec :: Int -> ReadS CreateLBCookieStickinessPolicyResponse
Prelude.Read, Int -> CreateLBCookieStickinessPolicyResponse -> ShowS
[CreateLBCookieStickinessPolicyResponse] -> ShowS
CreateLBCookieStickinessPolicyResponse -> String
(Int -> CreateLBCookieStickinessPolicyResponse -> ShowS)
-> (CreateLBCookieStickinessPolicyResponse -> String)
-> ([CreateLBCookieStickinessPolicyResponse] -> ShowS)
-> Show CreateLBCookieStickinessPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLBCookieStickinessPolicyResponse] -> ShowS
$cshowList :: [CreateLBCookieStickinessPolicyResponse] -> ShowS
show :: CreateLBCookieStickinessPolicyResponse -> String
$cshow :: CreateLBCookieStickinessPolicyResponse -> String
showsPrec :: Int -> CreateLBCookieStickinessPolicyResponse -> ShowS
$cshowsPrec :: Int -> CreateLBCookieStickinessPolicyResponse -> ShowS
Prelude.Show, (forall x.
CreateLBCookieStickinessPolicyResponse
-> Rep CreateLBCookieStickinessPolicyResponse x)
-> (forall x.
Rep CreateLBCookieStickinessPolicyResponse x
-> CreateLBCookieStickinessPolicyResponse)
-> Generic CreateLBCookieStickinessPolicyResponse
forall x.
Rep CreateLBCookieStickinessPolicyResponse x
-> CreateLBCookieStickinessPolicyResponse
forall x.
CreateLBCookieStickinessPolicyResponse
-> Rep CreateLBCookieStickinessPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLBCookieStickinessPolicyResponse x
-> CreateLBCookieStickinessPolicyResponse
$cfrom :: forall x.
CreateLBCookieStickinessPolicyResponse
-> Rep CreateLBCookieStickinessPolicyResponse x
Prelude.Generic)
newCreateLBCookieStickinessPolicyResponse ::
Prelude.Int ->
CreateLBCookieStickinessPolicyResponse
newCreateLBCookieStickinessPolicyResponse :: Int -> CreateLBCookieStickinessPolicyResponse
newCreateLBCookieStickinessPolicyResponse
Int
pHttpStatus_ =
CreateLBCookieStickinessPolicyResponse' :: Int -> CreateLBCookieStickinessPolicyResponse
CreateLBCookieStickinessPolicyResponse'
{ $sel:httpStatus:CreateLBCookieStickinessPolicyResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createLBCookieStickinessPolicyResponse_httpStatus :: Lens.Lens' CreateLBCookieStickinessPolicyResponse Prelude.Int
createLBCookieStickinessPolicyResponse_httpStatus :: (Int -> f Int)
-> CreateLBCookieStickinessPolicyResponse
-> f CreateLBCookieStickinessPolicyResponse
createLBCookieStickinessPolicyResponse_httpStatus = (CreateLBCookieStickinessPolicyResponse -> Int)
-> (CreateLBCookieStickinessPolicyResponse
-> Int -> CreateLBCookieStickinessPolicyResponse)
-> Lens
CreateLBCookieStickinessPolicyResponse
CreateLBCookieStickinessPolicyResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLBCookieStickinessPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateLBCookieStickinessPolicyResponse' :: CreateLBCookieStickinessPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateLBCookieStickinessPolicyResponse
s@CreateLBCookieStickinessPolicyResponse' {} Int
a -> CreateLBCookieStickinessPolicyResponse
s {$sel:httpStatus:CreateLBCookieStickinessPolicyResponse' :: Int
httpStatus = Int
a} :: CreateLBCookieStickinessPolicyResponse)
instance
Prelude.NFData
CreateLBCookieStickinessPolicyResponse