{-# 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.CreateAppCookieStickinessPolicy
(
CreateAppCookieStickinessPolicy (..),
newCreateAppCookieStickinessPolicy,
createAppCookieStickinessPolicy_loadBalancerName,
createAppCookieStickinessPolicy_policyName,
createAppCookieStickinessPolicy_cookieName,
CreateAppCookieStickinessPolicyResponse (..),
newCreateAppCookieStickinessPolicyResponse,
createAppCookieStickinessPolicyResponse_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 CreateAppCookieStickinessPolicy = CreateAppCookieStickinessPolicy'
{
CreateAppCookieStickinessPolicy -> Text
loadBalancerName :: Prelude.Text,
CreateAppCookieStickinessPolicy -> Text
policyName :: Prelude.Text,
CreateAppCookieStickinessPolicy -> Text
cookieName :: Prelude.Text
}
deriving (CreateAppCookieStickinessPolicy
-> CreateAppCookieStickinessPolicy -> Bool
(CreateAppCookieStickinessPolicy
-> CreateAppCookieStickinessPolicy -> Bool)
-> (CreateAppCookieStickinessPolicy
-> CreateAppCookieStickinessPolicy -> Bool)
-> Eq CreateAppCookieStickinessPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAppCookieStickinessPolicy
-> CreateAppCookieStickinessPolicy -> Bool
$c/= :: CreateAppCookieStickinessPolicy
-> CreateAppCookieStickinessPolicy -> Bool
== :: CreateAppCookieStickinessPolicy
-> CreateAppCookieStickinessPolicy -> Bool
$c== :: CreateAppCookieStickinessPolicy
-> CreateAppCookieStickinessPolicy -> Bool
Prelude.Eq, ReadPrec [CreateAppCookieStickinessPolicy]
ReadPrec CreateAppCookieStickinessPolicy
Int -> ReadS CreateAppCookieStickinessPolicy
ReadS [CreateAppCookieStickinessPolicy]
(Int -> ReadS CreateAppCookieStickinessPolicy)
-> ReadS [CreateAppCookieStickinessPolicy]
-> ReadPrec CreateAppCookieStickinessPolicy
-> ReadPrec [CreateAppCookieStickinessPolicy]
-> Read CreateAppCookieStickinessPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAppCookieStickinessPolicy]
$creadListPrec :: ReadPrec [CreateAppCookieStickinessPolicy]
readPrec :: ReadPrec CreateAppCookieStickinessPolicy
$creadPrec :: ReadPrec CreateAppCookieStickinessPolicy
readList :: ReadS [CreateAppCookieStickinessPolicy]
$creadList :: ReadS [CreateAppCookieStickinessPolicy]
readsPrec :: Int -> ReadS CreateAppCookieStickinessPolicy
$creadsPrec :: Int -> ReadS CreateAppCookieStickinessPolicy
Prelude.Read, Int -> CreateAppCookieStickinessPolicy -> ShowS
[CreateAppCookieStickinessPolicy] -> ShowS
CreateAppCookieStickinessPolicy -> String
(Int -> CreateAppCookieStickinessPolicy -> ShowS)
-> (CreateAppCookieStickinessPolicy -> String)
-> ([CreateAppCookieStickinessPolicy] -> ShowS)
-> Show CreateAppCookieStickinessPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAppCookieStickinessPolicy] -> ShowS
$cshowList :: [CreateAppCookieStickinessPolicy] -> ShowS
show :: CreateAppCookieStickinessPolicy -> String
$cshow :: CreateAppCookieStickinessPolicy -> String
showsPrec :: Int -> CreateAppCookieStickinessPolicy -> ShowS
$cshowsPrec :: Int -> CreateAppCookieStickinessPolicy -> ShowS
Prelude.Show, (forall x.
CreateAppCookieStickinessPolicy
-> Rep CreateAppCookieStickinessPolicy x)
-> (forall x.
Rep CreateAppCookieStickinessPolicy x
-> CreateAppCookieStickinessPolicy)
-> Generic CreateAppCookieStickinessPolicy
forall x.
Rep CreateAppCookieStickinessPolicy x
-> CreateAppCookieStickinessPolicy
forall x.
CreateAppCookieStickinessPolicy
-> Rep CreateAppCookieStickinessPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAppCookieStickinessPolicy x
-> CreateAppCookieStickinessPolicy
$cfrom :: forall x.
CreateAppCookieStickinessPolicy
-> Rep CreateAppCookieStickinessPolicy x
Prelude.Generic)
newCreateAppCookieStickinessPolicy ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateAppCookieStickinessPolicy
newCreateAppCookieStickinessPolicy :: Text -> Text -> Text -> CreateAppCookieStickinessPolicy
newCreateAppCookieStickinessPolicy
Text
pLoadBalancerName_
Text
pPolicyName_
Text
pCookieName_ =
CreateAppCookieStickinessPolicy' :: Text -> Text -> Text -> CreateAppCookieStickinessPolicy
CreateAppCookieStickinessPolicy'
{ $sel:loadBalancerName:CreateAppCookieStickinessPolicy' :: Text
loadBalancerName =
Text
pLoadBalancerName_,
$sel:policyName:CreateAppCookieStickinessPolicy' :: Text
policyName = Text
pPolicyName_,
$sel:cookieName:CreateAppCookieStickinessPolicy' :: Text
cookieName = Text
pCookieName_
}
createAppCookieStickinessPolicy_loadBalancerName :: Lens.Lens' CreateAppCookieStickinessPolicy Prelude.Text
createAppCookieStickinessPolicy_loadBalancerName :: (Text -> f Text)
-> CreateAppCookieStickinessPolicy
-> f CreateAppCookieStickinessPolicy
createAppCookieStickinessPolicy_loadBalancerName = (CreateAppCookieStickinessPolicy -> Text)
-> (CreateAppCookieStickinessPolicy
-> Text -> CreateAppCookieStickinessPolicy)
-> Lens
CreateAppCookieStickinessPolicy
CreateAppCookieStickinessPolicy
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppCookieStickinessPolicy' {Text
loadBalancerName :: Text
$sel:loadBalancerName:CreateAppCookieStickinessPolicy' :: CreateAppCookieStickinessPolicy -> Text
loadBalancerName} -> Text
loadBalancerName) (\s :: CreateAppCookieStickinessPolicy
s@CreateAppCookieStickinessPolicy' {} Text
a -> CreateAppCookieStickinessPolicy
s {$sel:loadBalancerName:CreateAppCookieStickinessPolicy' :: Text
loadBalancerName = Text
a} :: CreateAppCookieStickinessPolicy)
createAppCookieStickinessPolicy_policyName :: Lens.Lens' CreateAppCookieStickinessPolicy Prelude.Text
createAppCookieStickinessPolicy_policyName :: (Text -> f Text)
-> CreateAppCookieStickinessPolicy
-> f CreateAppCookieStickinessPolicy
createAppCookieStickinessPolicy_policyName = (CreateAppCookieStickinessPolicy -> Text)
-> (CreateAppCookieStickinessPolicy
-> Text -> CreateAppCookieStickinessPolicy)
-> Lens
CreateAppCookieStickinessPolicy
CreateAppCookieStickinessPolicy
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppCookieStickinessPolicy' {Text
policyName :: Text
$sel:policyName:CreateAppCookieStickinessPolicy' :: CreateAppCookieStickinessPolicy -> Text
policyName} -> Text
policyName) (\s :: CreateAppCookieStickinessPolicy
s@CreateAppCookieStickinessPolicy' {} Text
a -> CreateAppCookieStickinessPolicy
s {$sel:policyName:CreateAppCookieStickinessPolicy' :: Text
policyName = Text
a} :: CreateAppCookieStickinessPolicy)
createAppCookieStickinessPolicy_cookieName :: Lens.Lens' CreateAppCookieStickinessPolicy Prelude.Text
createAppCookieStickinessPolicy_cookieName :: (Text -> f Text)
-> CreateAppCookieStickinessPolicy
-> f CreateAppCookieStickinessPolicy
createAppCookieStickinessPolicy_cookieName = (CreateAppCookieStickinessPolicy -> Text)
-> (CreateAppCookieStickinessPolicy
-> Text -> CreateAppCookieStickinessPolicy)
-> Lens
CreateAppCookieStickinessPolicy
CreateAppCookieStickinessPolicy
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppCookieStickinessPolicy' {Text
cookieName :: Text
$sel:cookieName:CreateAppCookieStickinessPolicy' :: CreateAppCookieStickinessPolicy -> Text
cookieName} -> Text
cookieName) (\s :: CreateAppCookieStickinessPolicy
s@CreateAppCookieStickinessPolicy' {} Text
a -> CreateAppCookieStickinessPolicy
s {$sel:cookieName:CreateAppCookieStickinessPolicy' :: Text
cookieName = Text
a} :: CreateAppCookieStickinessPolicy)
instance
Core.AWSRequest
CreateAppCookieStickinessPolicy
where
type
AWSResponse CreateAppCookieStickinessPolicy =
CreateAppCookieStickinessPolicyResponse
request :: CreateAppCookieStickinessPolicy
-> Request CreateAppCookieStickinessPolicy
request = Service
-> CreateAppCookieStickinessPolicy
-> Request CreateAppCookieStickinessPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CreateAppCookieStickinessPolicy
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CreateAppCookieStickinessPolicy)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CreateAppCookieStickinessPolicy))
-> Logger
-> Service
-> Proxy CreateAppCookieStickinessPolicy
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CreateAppCookieStickinessPolicy)))
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
"CreateAppCookieStickinessPolicyResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> CreateAppCookieStickinessPolicyResponse
CreateAppCookieStickinessPolicyResponse'
(Int -> CreateAppCookieStickinessPolicyResponse)
-> Either String Int
-> Either String CreateAppCookieStickinessPolicyResponse
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
CreateAppCookieStickinessPolicy
instance
Prelude.NFData
CreateAppCookieStickinessPolicy
instance
Core.ToHeaders
CreateAppCookieStickinessPolicy
where
toHeaders :: CreateAppCookieStickinessPolicy -> ResponseHeaders
toHeaders = ResponseHeaders
-> CreateAppCookieStickinessPolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CreateAppCookieStickinessPolicy where
toPath :: CreateAppCookieStickinessPolicy -> ByteString
toPath = ByteString -> CreateAppCookieStickinessPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateAppCookieStickinessPolicy where
toQuery :: CreateAppCookieStickinessPolicy -> QueryString
toQuery CreateAppCookieStickinessPolicy' {Text
cookieName :: Text
policyName :: Text
loadBalancerName :: Text
$sel:cookieName:CreateAppCookieStickinessPolicy' :: CreateAppCookieStickinessPolicy -> Text
$sel:policyName:CreateAppCookieStickinessPolicy' :: CreateAppCookieStickinessPolicy -> Text
$sel:loadBalancerName:CreateAppCookieStickinessPolicy' :: CreateAppCookieStickinessPolicy -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"CreateAppCookieStickinessPolicy" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-06-01" :: Prelude.ByteString),
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,
ByteString
"CookieName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
cookieName
]
data CreateAppCookieStickinessPolicyResponse = CreateAppCookieStickinessPolicyResponse'
{
CreateAppCookieStickinessPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateAppCookieStickinessPolicyResponse
-> CreateAppCookieStickinessPolicyResponse -> Bool
(CreateAppCookieStickinessPolicyResponse
-> CreateAppCookieStickinessPolicyResponse -> Bool)
-> (CreateAppCookieStickinessPolicyResponse
-> CreateAppCookieStickinessPolicyResponse -> Bool)
-> Eq CreateAppCookieStickinessPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAppCookieStickinessPolicyResponse
-> CreateAppCookieStickinessPolicyResponse -> Bool
$c/= :: CreateAppCookieStickinessPolicyResponse
-> CreateAppCookieStickinessPolicyResponse -> Bool
== :: CreateAppCookieStickinessPolicyResponse
-> CreateAppCookieStickinessPolicyResponse -> Bool
$c== :: CreateAppCookieStickinessPolicyResponse
-> CreateAppCookieStickinessPolicyResponse -> Bool
Prelude.Eq, ReadPrec [CreateAppCookieStickinessPolicyResponse]
ReadPrec CreateAppCookieStickinessPolicyResponse
Int -> ReadS CreateAppCookieStickinessPolicyResponse
ReadS [CreateAppCookieStickinessPolicyResponse]
(Int -> ReadS CreateAppCookieStickinessPolicyResponse)
-> ReadS [CreateAppCookieStickinessPolicyResponse]
-> ReadPrec CreateAppCookieStickinessPolicyResponse
-> ReadPrec [CreateAppCookieStickinessPolicyResponse]
-> Read CreateAppCookieStickinessPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAppCookieStickinessPolicyResponse]
$creadListPrec :: ReadPrec [CreateAppCookieStickinessPolicyResponse]
readPrec :: ReadPrec CreateAppCookieStickinessPolicyResponse
$creadPrec :: ReadPrec CreateAppCookieStickinessPolicyResponse
readList :: ReadS [CreateAppCookieStickinessPolicyResponse]
$creadList :: ReadS [CreateAppCookieStickinessPolicyResponse]
readsPrec :: Int -> ReadS CreateAppCookieStickinessPolicyResponse
$creadsPrec :: Int -> ReadS CreateAppCookieStickinessPolicyResponse
Prelude.Read, Int -> CreateAppCookieStickinessPolicyResponse -> ShowS
[CreateAppCookieStickinessPolicyResponse] -> ShowS
CreateAppCookieStickinessPolicyResponse -> String
(Int -> CreateAppCookieStickinessPolicyResponse -> ShowS)
-> (CreateAppCookieStickinessPolicyResponse -> String)
-> ([CreateAppCookieStickinessPolicyResponse] -> ShowS)
-> Show CreateAppCookieStickinessPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAppCookieStickinessPolicyResponse] -> ShowS
$cshowList :: [CreateAppCookieStickinessPolicyResponse] -> ShowS
show :: CreateAppCookieStickinessPolicyResponse -> String
$cshow :: CreateAppCookieStickinessPolicyResponse -> String
showsPrec :: Int -> CreateAppCookieStickinessPolicyResponse -> ShowS
$cshowsPrec :: Int -> CreateAppCookieStickinessPolicyResponse -> ShowS
Prelude.Show, (forall x.
CreateAppCookieStickinessPolicyResponse
-> Rep CreateAppCookieStickinessPolicyResponse x)
-> (forall x.
Rep CreateAppCookieStickinessPolicyResponse x
-> CreateAppCookieStickinessPolicyResponse)
-> Generic CreateAppCookieStickinessPolicyResponse
forall x.
Rep CreateAppCookieStickinessPolicyResponse x
-> CreateAppCookieStickinessPolicyResponse
forall x.
CreateAppCookieStickinessPolicyResponse
-> Rep CreateAppCookieStickinessPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAppCookieStickinessPolicyResponse x
-> CreateAppCookieStickinessPolicyResponse
$cfrom :: forall x.
CreateAppCookieStickinessPolicyResponse
-> Rep CreateAppCookieStickinessPolicyResponse x
Prelude.Generic)
newCreateAppCookieStickinessPolicyResponse ::
Prelude.Int ->
CreateAppCookieStickinessPolicyResponse
newCreateAppCookieStickinessPolicyResponse :: Int -> CreateAppCookieStickinessPolicyResponse
newCreateAppCookieStickinessPolicyResponse
Int
pHttpStatus_ =
CreateAppCookieStickinessPolicyResponse' :: Int -> CreateAppCookieStickinessPolicyResponse
CreateAppCookieStickinessPolicyResponse'
{ $sel:httpStatus:CreateAppCookieStickinessPolicyResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createAppCookieStickinessPolicyResponse_httpStatus :: Lens.Lens' CreateAppCookieStickinessPolicyResponse Prelude.Int
createAppCookieStickinessPolicyResponse_httpStatus :: (Int -> f Int)
-> CreateAppCookieStickinessPolicyResponse
-> f CreateAppCookieStickinessPolicyResponse
createAppCookieStickinessPolicyResponse_httpStatus = (CreateAppCookieStickinessPolicyResponse -> Int)
-> (CreateAppCookieStickinessPolicyResponse
-> Int -> CreateAppCookieStickinessPolicyResponse)
-> Lens
CreateAppCookieStickinessPolicyResponse
CreateAppCookieStickinessPolicyResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppCookieStickinessPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateAppCookieStickinessPolicyResponse' :: CreateAppCookieStickinessPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateAppCookieStickinessPolicyResponse
s@CreateAppCookieStickinessPolicyResponse' {} Int
a -> CreateAppCookieStickinessPolicyResponse
s {$sel:httpStatus:CreateAppCookieStickinessPolicyResponse' :: Int
httpStatus = Int
a} :: CreateAppCookieStickinessPolicyResponse)
instance
Prelude.NFData
CreateAppCookieStickinessPolicyResponse