{-# 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.APIGateway.CreateAuthorizer
(
CreateAuthorizer (..),
newCreateAuthorizer,
createAuthorizer_authorizerUri,
createAuthorizer_identityValidationExpression,
createAuthorizer_providerARNs,
createAuthorizer_authorizerResultTtlInSeconds,
createAuthorizer_authType,
createAuthorizer_identitySource,
createAuthorizer_authorizerCredentials,
createAuthorizer_restApiId,
createAuthorizer_name,
createAuthorizer_type,
Authorizer (..),
newAuthorizer,
authorizer_authorizerUri,
authorizer_identityValidationExpression,
authorizer_providerARNs,
authorizer_name,
authorizer_id,
authorizer_authorizerResultTtlInSeconds,
authorizer_authType,
authorizer_type,
authorizer_identitySource,
authorizer_authorizerCredentials,
)
where
import Amazonka.APIGateway.Types
import qualified Amazonka.Core as Core
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 CreateAuthorizer = CreateAuthorizer'
{
CreateAuthorizer -> Maybe Text
authorizerUri :: Prelude.Maybe Prelude.Text,
CreateAuthorizer -> Maybe Text
identityValidationExpression :: Prelude.Maybe Prelude.Text,
CreateAuthorizer -> Maybe [Text]
providerARNs :: Prelude.Maybe [Prelude.Text],
CreateAuthorizer -> Maybe Int
authorizerResultTtlInSeconds :: Prelude.Maybe Prelude.Int,
CreateAuthorizer -> Maybe Text
authType :: Prelude.Maybe Prelude.Text,
CreateAuthorizer -> Maybe Text
identitySource :: Prelude.Maybe Prelude.Text,
CreateAuthorizer -> Maybe Text
authorizerCredentials :: Prelude.Maybe Prelude.Text,
CreateAuthorizer -> Text
restApiId :: Prelude.Text,
CreateAuthorizer -> Text
name :: Prelude.Text,
CreateAuthorizer -> AuthorizerType
type' :: AuthorizerType
}
deriving (CreateAuthorizer -> CreateAuthorizer -> Bool
(CreateAuthorizer -> CreateAuthorizer -> Bool)
-> (CreateAuthorizer -> CreateAuthorizer -> Bool)
-> Eq CreateAuthorizer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAuthorizer -> CreateAuthorizer -> Bool
$c/= :: CreateAuthorizer -> CreateAuthorizer -> Bool
== :: CreateAuthorizer -> CreateAuthorizer -> Bool
$c== :: CreateAuthorizer -> CreateAuthorizer -> Bool
Prelude.Eq, ReadPrec [CreateAuthorizer]
ReadPrec CreateAuthorizer
Int -> ReadS CreateAuthorizer
ReadS [CreateAuthorizer]
(Int -> ReadS CreateAuthorizer)
-> ReadS [CreateAuthorizer]
-> ReadPrec CreateAuthorizer
-> ReadPrec [CreateAuthorizer]
-> Read CreateAuthorizer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAuthorizer]
$creadListPrec :: ReadPrec [CreateAuthorizer]
readPrec :: ReadPrec CreateAuthorizer
$creadPrec :: ReadPrec CreateAuthorizer
readList :: ReadS [CreateAuthorizer]
$creadList :: ReadS [CreateAuthorizer]
readsPrec :: Int -> ReadS CreateAuthorizer
$creadsPrec :: Int -> ReadS CreateAuthorizer
Prelude.Read, Int -> CreateAuthorizer -> ShowS
[CreateAuthorizer] -> ShowS
CreateAuthorizer -> String
(Int -> CreateAuthorizer -> ShowS)
-> (CreateAuthorizer -> String)
-> ([CreateAuthorizer] -> ShowS)
-> Show CreateAuthorizer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAuthorizer] -> ShowS
$cshowList :: [CreateAuthorizer] -> ShowS
show :: CreateAuthorizer -> String
$cshow :: CreateAuthorizer -> String
showsPrec :: Int -> CreateAuthorizer -> ShowS
$cshowsPrec :: Int -> CreateAuthorizer -> ShowS
Prelude.Show, (forall x. CreateAuthorizer -> Rep CreateAuthorizer x)
-> (forall x. Rep CreateAuthorizer x -> CreateAuthorizer)
-> Generic CreateAuthorizer
forall x. Rep CreateAuthorizer x -> CreateAuthorizer
forall x. CreateAuthorizer -> Rep CreateAuthorizer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAuthorizer x -> CreateAuthorizer
$cfrom :: forall x. CreateAuthorizer -> Rep CreateAuthorizer x
Prelude.Generic)
newCreateAuthorizer ::
Prelude.Text ->
Prelude.Text ->
AuthorizerType ->
CreateAuthorizer
newCreateAuthorizer :: Text -> Text -> AuthorizerType -> CreateAuthorizer
newCreateAuthorizer Text
pRestApiId_ Text
pName_ AuthorizerType
pType_ =
CreateAuthorizer' :: Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> AuthorizerType
-> CreateAuthorizer
CreateAuthorizer'
{ $sel:authorizerUri:CreateAuthorizer' :: Maybe Text
authorizerUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:identityValidationExpression:CreateAuthorizer' :: Maybe Text
identityValidationExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:providerARNs:CreateAuthorizer' :: Maybe [Text]
providerARNs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:authorizerResultTtlInSeconds:CreateAuthorizer' :: Maybe Int
authorizerResultTtlInSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:authType:CreateAuthorizer' :: Maybe Text
authType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:identitySource:CreateAuthorizer' :: Maybe Text
identitySource = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:authorizerCredentials:CreateAuthorizer' :: Maybe Text
authorizerCredentials = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:restApiId:CreateAuthorizer' :: Text
restApiId = Text
pRestApiId_,
$sel:name:CreateAuthorizer' :: Text
name = Text
pName_,
$sel:type':CreateAuthorizer' :: AuthorizerType
type' = AuthorizerType
pType_
}
createAuthorizer_authorizerUri :: Lens.Lens' CreateAuthorizer (Prelude.Maybe Prelude.Text)
createAuthorizer_authorizerUri :: (Maybe Text -> f (Maybe Text))
-> CreateAuthorizer -> f CreateAuthorizer
createAuthorizer_authorizerUri = (CreateAuthorizer -> Maybe Text)
-> (CreateAuthorizer -> Maybe Text -> CreateAuthorizer)
-> Lens CreateAuthorizer CreateAuthorizer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAuthorizer' {Maybe Text
authorizerUri :: Maybe Text
$sel:authorizerUri:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
authorizerUri} -> Maybe Text
authorizerUri) (\s :: CreateAuthorizer
s@CreateAuthorizer' {} Maybe Text
a -> CreateAuthorizer
s {$sel:authorizerUri:CreateAuthorizer' :: Maybe Text
authorizerUri = Maybe Text
a} :: CreateAuthorizer)
createAuthorizer_identityValidationExpression :: Lens.Lens' CreateAuthorizer (Prelude.Maybe Prelude.Text)
createAuthorizer_identityValidationExpression :: (Maybe Text -> f (Maybe Text))
-> CreateAuthorizer -> f CreateAuthorizer
createAuthorizer_identityValidationExpression = (CreateAuthorizer -> Maybe Text)
-> (CreateAuthorizer -> Maybe Text -> CreateAuthorizer)
-> Lens CreateAuthorizer CreateAuthorizer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAuthorizer' {Maybe Text
identityValidationExpression :: Maybe Text
$sel:identityValidationExpression:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
identityValidationExpression} -> Maybe Text
identityValidationExpression) (\s :: CreateAuthorizer
s@CreateAuthorizer' {} Maybe Text
a -> CreateAuthorizer
s {$sel:identityValidationExpression:CreateAuthorizer' :: Maybe Text
identityValidationExpression = Maybe Text
a} :: CreateAuthorizer)
createAuthorizer_providerARNs :: Lens.Lens' CreateAuthorizer (Prelude.Maybe [Prelude.Text])
createAuthorizer_providerARNs :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateAuthorizer -> f CreateAuthorizer
createAuthorizer_providerARNs = (CreateAuthorizer -> Maybe [Text])
-> (CreateAuthorizer -> Maybe [Text] -> CreateAuthorizer)
-> Lens
CreateAuthorizer CreateAuthorizer (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAuthorizer' {Maybe [Text]
providerARNs :: Maybe [Text]
$sel:providerARNs:CreateAuthorizer' :: CreateAuthorizer -> Maybe [Text]
providerARNs} -> Maybe [Text]
providerARNs) (\s :: CreateAuthorizer
s@CreateAuthorizer' {} Maybe [Text]
a -> CreateAuthorizer
s {$sel:providerARNs:CreateAuthorizer' :: Maybe [Text]
providerARNs = Maybe [Text]
a} :: CreateAuthorizer) ((Maybe [Text] -> f (Maybe [Text]))
-> CreateAuthorizer -> f CreateAuthorizer)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateAuthorizer
-> f CreateAuthorizer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createAuthorizer_authorizerResultTtlInSeconds :: Lens.Lens' CreateAuthorizer (Prelude.Maybe Prelude.Int)
createAuthorizer_authorizerResultTtlInSeconds :: (Maybe Int -> f (Maybe Int))
-> CreateAuthorizer -> f CreateAuthorizer
createAuthorizer_authorizerResultTtlInSeconds = (CreateAuthorizer -> Maybe Int)
-> (CreateAuthorizer -> Maybe Int -> CreateAuthorizer)
-> Lens CreateAuthorizer CreateAuthorizer (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAuthorizer' {Maybe Int
authorizerResultTtlInSeconds :: Maybe Int
$sel:authorizerResultTtlInSeconds:CreateAuthorizer' :: CreateAuthorizer -> Maybe Int
authorizerResultTtlInSeconds} -> Maybe Int
authorizerResultTtlInSeconds) (\s :: CreateAuthorizer
s@CreateAuthorizer' {} Maybe Int
a -> CreateAuthorizer
s {$sel:authorizerResultTtlInSeconds:CreateAuthorizer' :: Maybe Int
authorizerResultTtlInSeconds = Maybe Int
a} :: CreateAuthorizer)
createAuthorizer_authType :: Lens.Lens' CreateAuthorizer (Prelude.Maybe Prelude.Text)
createAuthorizer_authType :: (Maybe Text -> f (Maybe Text))
-> CreateAuthorizer -> f CreateAuthorizer
createAuthorizer_authType = (CreateAuthorizer -> Maybe Text)
-> (CreateAuthorizer -> Maybe Text -> CreateAuthorizer)
-> Lens CreateAuthorizer CreateAuthorizer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAuthorizer' {Maybe Text
authType :: Maybe Text
$sel:authType:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
authType} -> Maybe Text
authType) (\s :: CreateAuthorizer
s@CreateAuthorizer' {} Maybe Text
a -> CreateAuthorizer
s {$sel:authType:CreateAuthorizer' :: Maybe Text
authType = Maybe Text
a} :: CreateAuthorizer)
createAuthorizer_identitySource :: Lens.Lens' CreateAuthorizer (Prelude.Maybe Prelude.Text)
createAuthorizer_identitySource :: (Maybe Text -> f (Maybe Text))
-> CreateAuthorizer -> f CreateAuthorizer
createAuthorizer_identitySource = (CreateAuthorizer -> Maybe Text)
-> (CreateAuthorizer -> Maybe Text -> CreateAuthorizer)
-> Lens CreateAuthorizer CreateAuthorizer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAuthorizer' {Maybe Text
identitySource :: Maybe Text
$sel:identitySource:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
identitySource} -> Maybe Text
identitySource) (\s :: CreateAuthorizer
s@CreateAuthorizer' {} Maybe Text
a -> CreateAuthorizer
s {$sel:identitySource:CreateAuthorizer' :: Maybe Text
identitySource = Maybe Text
a} :: CreateAuthorizer)
createAuthorizer_authorizerCredentials :: Lens.Lens' CreateAuthorizer (Prelude.Maybe Prelude.Text)
createAuthorizer_authorizerCredentials :: (Maybe Text -> f (Maybe Text))
-> CreateAuthorizer -> f CreateAuthorizer
createAuthorizer_authorizerCredentials = (CreateAuthorizer -> Maybe Text)
-> (CreateAuthorizer -> Maybe Text -> CreateAuthorizer)
-> Lens CreateAuthorizer CreateAuthorizer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAuthorizer' {Maybe Text
authorizerCredentials :: Maybe Text
$sel:authorizerCredentials:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
authorizerCredentials} -> Maybe Text
authorizerCredentials) (\s :: CreateAuthorizer
s@CreateAuthorizer' {} Maybe Text
a -> CreateAuthorizer
s {$sel:authorizerCredentials:CreateAuthorizer' :: Maybe Text
authorizerCredentials = Maybe Text
a} :: CreateAuthorizer)
createAuthorizer_restApiId :: Lens.Lens' CreateAuthorizer Prelude.Text
createAuthorizer_restApiId :: (Text -> f Text) -> CreateAuthorizer -> f CreateAuthorizer
createAuthorizer_restApiId = (CreateAuthorizer -> Text)
-> (CreateAuthorizer -> Text -> CreateAuthorizer)
-> Lens CreateAuthorizer CreateAuthorizer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAuthorizer' {Text
restApiId :: Text
$sel:restApiId:CreateAuthorizer' :: CreateAuthorizer -> Text
restApiId} -> Text
restApiId) (\s :: CreateAuthorizer
s@CreateAuthorizer' {} Text
a -> CreateAuthorizer
s {$sel:restApiId:CreateAuthorizer' :: Text
restApiId = Text
a} :: CreateAuthorizer)
createAuthorizer_name :: Lens.Lens' CreateAuthorizer Prelude.Text
createAuthorizer_name :: (Text -> f Text) -> CreateAuthorizer -> f CreateAuthorizer
createAuthorizer_name = (CreateAuthorizer -> Text)
-> (CreateAuthorizer -> Text -> CreateAuthorizer)
-> Lens CreateAuthorizer CreateAuthorizer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAuthorizer' {Text
name :: Text
$sel:name:CreateAuthorizer' :: CreateAuthorizer -> Text
name} -> Text
name) (\s :: CreateAuthorizer
s@CreateAuthorizer' {} Text
a -> CreateAuthorizer
s {$sel:name:CreateAuthorizer' :: Text
name = Text
a} :: CreateAuthorizer)
createAuthorizer_type :: Lens.Lens' CreateAuthorizer AuthorizerType
createAuthorizer_type :: (AuthorizerType -> f AuthorizerType)
-> CreateAuthorizer -> f CreateAuthorizer
createAuthorizer_type = (CreateAuthorizer -> AuthorizerType)
-> (CreateAuthorizer -> AuthorizerType -> CreateAuthorizer)
-> Lens
CreateAuthorizer CreateAuthorizer AuthorizerType AuthorizerType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAuthorizer' {AuthorizerType
type' :: AuthorizerType
$sel:type':CreateAuthorizer' :: CreateAuthorizer -> AuthorizerType
type'} -> AuthorizerType
type') (\s :: CreateAuthorizer
s@CreateAuthorizer' {} AuthorizerType
a -> CreateAuthorizer
s {$sel:type':CreateAuthorizer' :: AuthorizerType
type' = AuthorizerType
a} :: CreateAuthorizer)
instance Core.AWSRequest CreateAuthorizer where
type AWSResponse CreateAuthorizer = Authorizer
request :: CreateAuthorizer -> Request CreateAuthorizer
request = Service -> CreateAuthorizer -> Request CreateAuthorizer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateAuthorizer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateAuthorizer)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateAuthorizer))
-> Logger
-> Service
-> Proxy CreateAuthorizer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateAuthorizer)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> Object -> Either String Authorizer
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable CreateAuthorizer
instance Prelude.NFData CreateAuthorizer
instance Core.ToHeaders CreateAuthorizer where
toHeaders :: CreateAuthorizer -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateAuthorizer -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Accept"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
]
)
instance Core.ToJSON CreateAuthorizer where
toJSON :: CreateAuthorizer -> Value
toJSON CreateAuthorizer' {Maybe Int
Maybe [Text]
Maybe Text
Text
AuthorizerType
type' :: AuthorizerType
name :: Text
restApiId :: Text
authorizerCredentials :: Maybe Text
identitySource :: Maybe Text
authType :: Maybe Text
authorizerResultTtlInSeconds :: Maybe Int
providerARNs :: Maybe [Text]
identityValidationExpression :: Maybe Text
authorizerUri :: Maybe Text
$sel:type':CreateAuthorizer' :: CreateAuthorizer -> AuthorizerType
$sel:name:CreateAuthorizer' :: CreateAuthorizer -> Text
$sel:restApiId:CreateAuthorizer' :: CreateAuthorizer -> Text
$sel:authorizerCredentials:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
$sel:identitySource:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
$sel:authType:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
$sel:authorizerResultTtlInSeconds:CreateAuthorizer' :: CreateAuthorizer -> Maybe Int
$sel:providerARNs:CreateAuthorizer' :: CreateAuthorizer -> Maybe [Text]
$sel:identityValidationExpression:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
$sel:authorizerUri:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"authorizerUri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
authorizerUri,
(Text
"identityValidationExpression" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
identityValidationExpression,
(Text
"providerARNs" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
providerARNs,
(Text
"authorizerResultTtlInSeconds" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
authorizerResultTtlInSeconds,
(Text
"authType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
authType,
(Text
"identitySource" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
identitySource,
(Text
"authorizerCredentials" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
authorizerCredentials,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> AuthorizerType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AuthorizerType
type')
]
)
instance Core.ToPath CreateAuthorizer where
toPath :: CreateAuthorizer -> ByteString
toPath CreateAuthorizer' {Maybe Int
Maybe [Text]
Maybe Text
Text
AuthorizerType
type' :: AuthorizerType
name :: Text
restApiId :: Text
authorizerCredentials :: Maybe Text
identitySource :: Maybe Text
authType :: Maybe Text
authorizerResultTtlInSeconds :: Maybe Int
providerARNs :: Maybe [Text]
identityValidationExpression :: Maybe Text
authorizerUri :: Maybe Text
$sel:type':CreateAuthorizer' :: CreateAuthorizer -> AuthorizerType
$sel:name:CreateAuthorizer' :: CreateAuthorizer -> Text
$sel:restApiId:CreateAuthorizer' :: CreateAuthorizer -> Text
$sel:authorizerCredentials:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
$sel:identitySource:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
$sel:authType:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
$sel:authorizerResultTtlInSeconds:CreateAuthorizer' :: CreateAuthorizer -> Maybe Int
$sel:providerARNs:CreateAuthorizer' :: CreateAuthorizer -> Maybe [Text]
$sel:identityValidationExpression:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
$sel:authorizerUri:CreateAuthorizer' :: CreateAuthorizer -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/restapis/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
restApiId, ByteString
"/authorizers"]
instance Core.ToQuery CreateAuthorizer where
toQuery :: CreateAuthorizer -> QueryString
toQuery = QueryString -> CreateAuthorizer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty