{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ELB.Types
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
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]
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
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.
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'
{ $sel:cookieExpirationPeriod:CreateLBCookieStickinessPolicy' :: Maybe Integer
cookieExpirationPeriod =
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 :: Lens' CreateLBCookieStickinessPolicy (Maybe Integer)
createLBCookieStickinessPolicy_cookieExpirationPeriod = 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 :: Lens' CreateLBCookieStickinessPolicy Text
createLBCookieStickinessPolicy_loadBalancerName = 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 :: Lens' CreateLBCookieStickinessPolicy Text
createLBCookieStickinessPolicy_policyName = 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 :: (Service -> Service)
-> CreateLBCookieStickinessPolicy
-> Request CreateLBCookieStickinessPolicy
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 CreateLBCookieStickinessPolicy
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CreateLBCookieStickinessPolicy)))
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
"CreateLBCookieStickinessPolicyResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> CreateLBCookieStickinessPolicyResponse
CreateLBCookieStickinessPolicyResponse'
forall (f :: * -> *) a b. Functor 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
CreateLBCookieStickinessPolicy
where
hashWithSalt :: Int -> CreateLBCookieStickinessPolicy -> Int
hashWithSalt
Int
_salt
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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
cookieExpirationPeriod
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
loadBalancerName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policyName
instance
Prelude.NFData
CreateLBCookieStickinessPolicy
where
rnf :: CreateLBCookieStickinessPolicy -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
cookieExpirationPeriod
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
loadBalancerName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
policyName
instance
Data.ToHeaders
CreateLBCookieStickinessPolicy
where
toHeaders :: CreateLBCookieStickinessPolicy -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath CreateLBCookieStickinessPolicy where
toPath :: CreateLBCookieStickinessPolicy -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"CreateLBCookieStickinessPolicy" ::
Prelude.ByteString
),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-06-01" :: Prelude.ByteString),
ByteString
"CookieExpirationPeriod"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Integer
cookieExpirationPeriod,
ByteString
"LoadBalancerName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
loadBalancerName,
ByteString
"PolicyName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
policyName
]
data CreateLBCookieStickinessPolicyResponse = CreateLBCookieStickinessPolicyResponse'
{
CreateLBCookieStickinessPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateLBCookieStickinessPolicyResponse
-> CreateLBCookieStickinessPolicyResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:CreateLBCookieStickinessPolicyResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createLBCookieStickinessPolicyResponse_httpStatus :: Lens.Lens' CreateLBCookieStickinessPolicyResponse Prelude.Int
createLBCookieStickinessPolicyResponse_httpStatus :: Lens' CreateLBCookieStickinessPolicyResponse Int
createLBCookieStickinessPolicyResponse_httpStatus = 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
where
rnf :: CreateLBCookieStickinessPolicyResponse -> ()
rnf CreateLBCookieStickinessPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateLBCookieStickinessPolicyResponse' :: CreateLBCookieStickinessPolicyResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus