{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ApiGatewayV2.CreateRoute
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a Route for an API.
module Amazonka.ApiGatewayV2.CreateRoute
  ( -- * Creating a Request
    CreateRoute (..),
    newCreateRoute,

    -- * Request Lenses
    createRoute_authorizationScopes,
    createRoute_modelSelectionExpression,
    createRoute_requestModels,
    createRoute_routeResponseSelectionExpression,
    createRoute_requestParameters,
    createRoute_authorizerId,
    createRoute_operationName,
    createRoute_authorizationType,
    createRoute_apiKeyRequired,
    createRoute_target,
    createRoute_apiId,
    createRoute_routeKey,

    -- * Destructuring the Response
    CreateRouteResponse' (..),
    newCreateRouteResponse',

    -- * Response Lenses
    createRouteResponse'_authorizationScopes,
    createRouteResponse'_modelSelectionExpression,
    createRouteResponse'_requestModels,
    createRouteResponse'_routeResponseSelectionExpression,
    createRouteResponse'_requestParameters,
    createRouteResponse'_routeId,
    createRouteResponse'_authorizerId,
    createRouteResponse'_operationName,
    createRouteResponse'_apiGatewayManaged,
    createRouteResponse'_authorizationType,
    createRouteResponse'_apiKeyRequired,
    createRouteResponse'_routeKey,
    createRouteResponse'_target,
    createRouteResponse'_httpStatus,
  )
where

import Amazonka.ApiGatewayV2.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

-- | Creates a new Route resource to represent a route.
--
-- /See:/ 'newCreateRoute' smart constructor.
data CreateRoute = CreateRoute'
  { -- | The authorization scopes supported by this route.
    CreateRoute -> Maybe [Text]
authorizationScopes :: Prelude.Maybe [Prelude.Text],
    -- | The model selection expression for the route. Supported only for
    -- WebSocket APIs.
    CreateRoute -> Maybe Text
modelSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | The request models for the route. Supported only for WebSocket APIs.
    CreateRoute -> Maybe (HashMap Text Text)
requestModels :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The route response selection expression for the route. Supported only
    -- for WebSocket APIs.
    CreateRoute -> Maybe Text
routeResponseSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | The request parameters for the route. Supported only for WebSocket APIs.
    CreateRoute -> Maybe (HashMap Text ParameterConstraints)
requestParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text ParameterConstraints),
    -- | The identifier of the Authorizer resource to be associated with this
    -- route. The authorizer identifier is generated by API Gateway when you
    -- created the authorizer.
    CreateRoute -> Maybe Text
authorizerId :: Prelude.Maybe Prelude.Text,
    -- | The operation name for the route.
    CreateRoute -> Maybe Text
operationName :: Prelude.Maybe Prelude.Text,
    -- | The authorization type for the route. For WebSocket APIs, valid values
    -- are NONE for open access, AWS_IAM for using AWS IAM permissions, and
    -- CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are
    -- NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using
    -- AWS IAM permissions, and CUSTOM for using a Lambda authorizer.
    CreateRoute -> Maybe AuthorizationType
authorizationType :: Prelude.Maybe AuthorizationType,
    -- | Specifies whether an API key is required for the route. Supported only
    -- for WebSocket APIs.
    CreateRoute -> Maybe Bool
apiKeyRequired :: Prelude.Maybe Prelude.Bool,
    -- | The target for the route.
    CreateRoute -> Maybe Text
target :: Prelude.Maybe Prelude.Text,
    -- | The API identifier.
    CreateRoute -> Text
apiId :: Prelude.Text,
    -- | The route key for the route.
    CreateRoute -> Text
routeKey :: Prelude.Text
  }
  deriving (CreateRoute -> CreateRoute -> Bool
(CreateRoute -> CreateRoute -> Bool)
-> (CreateRoute -> CreateRoute -> Bool) -> Eq CreateRoute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRoute -> CreateRoute -> Bool
$c/= :: CreateRoute -> CreateRoute -> Bool
== :: CreateRoute -> CreateRoute -> Bool
$c== :: CreateRoute -> CreateRoute -> Bool
Prelude.Eq, ReadPrec [CreateRoute]
ReadPrec CreateRoute
Int -> ReadS CreateRoute
ReadS [CreateRoute]
(Int -> ReadS CreateRoute)
-> ReadS [CreateRoute]
-> ReadPrec CreateRoute
-> ReadPrec [CreateRoute]
-> Read CreateRoute
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRoute]
$creadListPrec :: ReadPrec [CreateRoute]
readPrec :: ReadPrec CreateRoute
$creadPrec :: ReadPrec CreateRoute
readList :: ReadS [CreateRoute]
$creadList :: ReadS [CreateRoute]
readsPrec :: Int -> ReadS CreateRoute
$creadsPrec :: Int -> ReadS CreateRoute
Prelude.Read, Int -> CreateRoute -> ShowS
[CreateRoute] -> ShowS
CreateRoute -> String
(Int -> CreateRoute -> ShowS)
-> (CreateRoute -> String)
-> ([CreateRoute] -> ShowS)
-> Show CreateRoute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRoute] -> ShowS
$cshowList :: [CreateRoute] -> ShowS
show :: CreateRoute -> String
$cshow :: CreateRoute -> String
showsPrec :: Int -> CreateRoute -> ShowS
$cshowsPrec :: Int -> CreateRoute -> ShowS
Prelude.Show, (forall x. CreateRoute -> Rep CreateRoute x)
-> (forall x. Rep CreateRoute x -> CreateRoute)
-> Generic CreateRoute
forall x. Rep CreateRoute x -> CreateRoute
forall x. CreateRoute -> Rep CreateRoute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateRoute x -> CreateRoute
$cfrom :: forall x. CreateRoute -> Rep CreateRoute x
Prelude.Generic)

-- |
-- Create a value of 'CreateRoute' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'authorizationScopes', 'createRoute_authorizationScopes' - The authorization scopes supported by this route.
--
-- 'modelSelectionExpression', 'createRoute_modelSelectionExpression' - The model selection expression for the route. Supported only for
-- WebSocket APIs.
--
-- 'requestModels', 'createRoute_requestModels' - The request models for the route. Supported only for WebSocket APIs.
--
-- 'routeResponseSelectionExpression', 'createRoute_routeResponseSelectionExpression' - The route response selection expression for the route. Supported only
-- for WebSocket APIs.
--
-- 'requestParameters', 'createRoute_requestParameters' - The request parameters for the route. Supported only for WebSocket APIs.
--
-- 'authorizerId', 'createRoute_authorizerId' - The identifier of the Authorizer resource to be associated with this
-- route. The authorizer identifier is generated by API Gateway when you
-- created the authorizer.
--
-- 'operationName', 'createRoute_operationName' - The operation name for the route.
--
-- 'authorizationType', 'createRoute_authorizationType' - The authorization type for the route. For WebSocket APIs, valid values
-- are NONE for open access, AWS_IAM for using AWS IAM permissions, and
-- CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are
-- NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using
-- AWS IAM permissions, and CUSTOM for using a Lambda authorizer.
--
-- 'apiKeyRequired', 'createRoute_apiKeyRequired' - Specifies whether an API key is required for the route. Supported only
-- for WebSocket APIs.
--
-- 'target', 'createRoute_target' - The target for the route.
--
-- 'apiId', 'createRoute_apiId' - The API identifier.
--
-- 'routeKey', 'createRoute_routeKey' - The route key for the route.
newCreateRoute ::
  -- | 'apiId'
  Prelude.Text ->
  -- | 'routeKey'
  Prelude.Text ->
  CreateRoute
newCreateRoute :: Text -> Text -> CreateRoute
newCreateRoute Text
pApiId_ Text
pRouteKey_ =
  CreateRoute' :: Maybe [Text]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe (HashMap Text ParameterConstraints)
-> Maybe Text
-> Maybe Text
-> Maybe AuthorizationType
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> CreateRoute
CreateRoute'
    { $sel:authorizationScopes:CreateRoute' :: Maybe [Text]
authorizationScopes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:modelSelectionExpression:CreateRoute' :: Maybe Text
modelSelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:requestModels:CreateRoute' :: Maybe (HashMap Text Text)
requestModels = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:routeResponseSelectionExpression:CreateRoute' :: Maybe Text
routeResponseSelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:requestParameters:CreateRoute' :: Maybe (HashMap Text ParameterConstraints)
requestParameters = Maybe (HashMap Text ParameterConstraints)
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerId:CreateRoute' :: Maybe Text
authorizerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operationName:CreateRoute' :: Maybe Text
operationName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizationType:CreateRoute' :: Maybe AuthorizationType
authorizationType = Maybe AuthorizationType
forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeyRequired:CreateRoute' :: Maybe Bool
apiKeyRequired = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:target:CreateRoute' :: Maybe Text
target = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiId:CreateRoute' :: Text
apiId = Text
pApiId_,
      $sel:routeKey:CreateRoute' :: Text
routeKey = Text
pRouteKey_
    }

-- | The authorization scopes supported by this route.
createRoute_authorizationScopes :: Lens.Lens' CreateRoute (Prelude.Maybe [Prelude.Text])
createRoute_authorizationScopes :: (Maybe [Text] -> f (Maybe [Text])) -> CreateRoute -> f CreateRoute
createRoute_authorizationScopes = (CreateRoute -> Maybe [Text])
-> (CreateRoute -> Maybe [Text] -> CreateRoute)
-> Lens CreateRoute CreateRoute (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Maybe [Text]
authorizationScopes :: Maybe [Text]
$sel:authorizationScopes:CreateRoute' :: CreateRoute -> Maybe [Text]
authorizationScopes} -> Maybe [Text]
authorizationScopes) (\s :: CreateRoute
s@CreateRoute' {} Maybe [Text]
a -> CreateRoute
s {$sel:authorizationScopes:CreateRoute' :: Maybe [Text]
authorizationScopes = Maybe [Text]
a} :: CreateRoute) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateRoute -> f CreateRoute)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateRoute
-> f CreateRoute
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

-- | The model selection expression for the route. Supported only for
-- WebSocket APIs.
createRoute_modelSelectionExpression :: Lens.Lens' CreateRoute (Prelude.Maybe Prelude.Text)
createRoute_modelSelectionExpression :: (Maybe Text -> f (Maybe Text)) -> CreateRoute -> f CreateRoute
createRoute_modelSelectionExpression = (CreateRoute -> Maybe Text)
-> (CreateRoute -> Maybe Text -> CreateRoute)
-> Lens CreateRoute CreateRoute (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Maybe Text
modelSelectionExpression :: Maybe Text
$sel:modelSelectionExpression:CreateRoute' :: CreateRoute -> Maybe Text
modelSelectionExpression} -> Maybe Text
modelSelectionExpression) (\s :: CreateRoute
s@CreateRoute' {} Maybe Text
a -> CreateRoute
s {$sel:modelSelectionExpression:CreateRoute' :: Maybe Text
modelSelectionExpression = Maybe Text
a} :: CreateRoute)

-- | The request models for the route. Supported only for WebSocket APIs.
createRoute_requestModels :: Lens.Lens' CreateRoute (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createRoute_requestModels :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateRoute -> f CreateRoute
createRoute_requestModels = (CreateRoute -> Maybe (HashMap Text Text))
-> (CreateRoute -> Maybe (HashMap Text Text) -> CreateRoute)
-> Lens
     CreateRoute
     CreateRoute
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Maybe (HashMap Text Text)
requestModels :: Maybe (HashMap Text Text)
$sel:requestModels:CreateRoute' :: CreateRoute -> Maybe (HashMap Text Text)
requestModels} -> Maybe (HashMap Text Text)
requestModels) (\s :: CreateRoute
s@CreateRoute' {} Maybe (HashMap Text Text)
a -> CreateRoute
s {$sel:requestModels:CreateRoute' :: Maybe (HashMap Text Text)
requestModels = Maybe (HashMap Text Text)
a} :: CreateRoute) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateRoute -> f CreateRoute)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateRoute
-> f CreateRoute
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The route response selection expression for the route. Supported only
-- for WebSocket APIs.
createRoute_routeResponseSelectionExpression :: Lens.Lens' CreateRoute (Prelude.Maybe Prelude.Text)
createRoute_routeResponseSelectionExpression :: (Maybe Text -> f (Maybe Text)) -> CreateRoute -> f CreateRoute
createRoute_routeResponseSelectionExpression = (CreateRoute -> Maybe Text)
-> (CreateRoute -> Maybe Text -> CreateRoute)
-> Lens CreateRoute CreateRoute (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Maybe Text
routeResponseSelectionExpression :: Maybe Text
$sel:routeResponseSelectionExpression:CreateRoute' :: CreateRoute -> Maybe Text
routeResponseSelectionExpression} -> Maybe Text
routeResponseSelectionExpression) (\s :: CreateRoute
s@CreateRoute' {} Maybe Text
a -> CreateRoute
s {$sel:routeResponseSelectionExpression:CreateRoute' :: Maybe Text
routeResponseSelectionExpression = Maybe Text
a} :: CreateRoute)

-- | The request parameters for the route. Supported only for WebSocket APIs.
createRoute_requestParameters :: Lens.Lens' CreateRoute (Prelude.Maybe (Prelude.HashMap Prelude.Text ParameterConstraints))
createRoute_requestParameters :: (Maybe (HashMap Text ParameterConstraints)
 -> f (Maybe (HashMap Text ParameterConstraints)))
-> CreateRoute -> f CreateRoute
createRoute_requestParameters = (CreateRoute -> Maybe (HashMap Text ParameterConstraints))
-> (CreateRoute
    -> Maybe (HashMap Text ParameterConstraints) -> CreateRoute)
-> Lens
     CreateRoute
     CreateRoute
     (Maybe (HashMap Text ParameterConstraints))
     (Maybe (HashMap Text ParameterConstraints))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Maybe (HashMap Text ParameterConstraints)
requestParameters :: Maybe (HashMap Text ParameterConstraints)
$sel:requestParameters:CreateRoute' :: CreateRoute -> Maybe (HashMap Text ParameterConstraints)
requestParameters} -> Maybe (HashMap Text ParameterConstraints)
requestParameters) (\s :: CreateRoute
s@CreateRoute' {} Maybe (HashMap Text ParameterConstraints)
a -> CreateRoute
s {$sel:requestParameters:CreateRoute' :: Maybe (HashMap Text ParameterConstraints)
requestParameters = Maybe (HashMap Text ParameterConstraints)
a} :: CreateRoute) ((Maybe (HashMap Text ParameterConstraints)
  -> f (Maybe (HashMap Text ParameterConstraints)))
 -> CreateRoute -> f CreateRoute)
-> ((Maybe (HashMap Text ParameterConstraints)
     -> f (Maybe (HashMap Text ParameterConstraints)))
    -> Maybe (HashMap Text ParameterConstraints)
    -> f (Maybe (HashMap Text ParameterConstraints)))
-> (Maybe (HashMap Text ParameterConstraints)
    -> f (Maybe (HashMap Text ParameterConstraints)))
-> CreateRoute
-> f CreateRoute
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text ParameterConstraints)
  (HashMap Text ParameterConstraints)
  (HashMap Text ParameterConstraints)
  (HashMap Text ParameterConstraints)
-> Iso
     (Maybe (HashMap Text ParameterConstraints))
     (Maybe (HashMap Text ParameterConstraints))
     (Maybe (HashMap Text ParameterConstraints))
     (Maybe (HashMap Text ParameterConstraints))
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
  (HashMap Text ParameterConstraints)
  (HashMap Text ParameterConstraints)
  (HashMap Text ParameterConstraints)
  (HashMap Text ParameterConstraints)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier of the Authorizer resource to be associated with this
-- route. The authorizer identifier is generated by API Gateway when you
-- created the authorizer.
createRoute_authorizerId :: Lens.Lens' CreateRoute (Prelude.Maybe Prelude.Text)
createRoute_authorizerId :: (Maybe Text -> f (Maybe Text)) -> CreateRoute -> f CreateRoute
createRoute_authorizerId = (CreateRoute -> Maybe Text)
-> (CreateRoute -> Maybe Text -> CreateRoute)
-> Lens CreateRoute CreateRoute (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Maybe Text
authorizerId :: Maybe Text
$sel:authorizerId:CreateRoute' :: CreateRoute -> Maybe Text
authorizerId} -> Maybe Text
authorizerId) (\s :: CreateRoute
s@CreateRoute' {} Maybe Text
a -> CreateRoute
s {$sel:authorizerId:CreateRoute' :: Maybe Text
authorizerId = Maybe Text
a} :: CreateRoute)

-- | The operation name for the route.
createRoute_operationName :: Lens.Lens' CreateRoute (Prelude.Maybe Prelude.Text)
createRoute_operationName :: (Maybe Text -> f (Maybe Text)) -> CreateRoute -> f CreateRoute
createRoute_operationName = (CreateRoute -> Maybe Text)
-> (CreateRoute -> Maybe Text -> CreateRoute)
-> Lens CreateRoute CreateRoute (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Maybe Text
operationName :: Maybe Text
$sel:operationName:CreateRoute' :: CreateRoute -> Maybe Text
operationName} -> Maybe Text
operationName) (\s :: CreateRoute
s@CreateRoute' {} Maybe Text
a -> CreateRoute
s {$sel:operationName:CreateRoute' :: Maybe Text
operationName = Maybe Text
a} :: CreateRoute)

-- | The authorization type for the route. For WebSocket APIs, valid values
-- are NONE for open access, AWS_IAM for using AWS IAM permissions, and
-- CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are
-- NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using
-- AWS IAM permissions, and CUSTOM for using a Lambda authorizer.
createRoute_authorizationType :: Lens.Lens' CreateRoute (Prelude.Maybe AuthorizationType)
createRoute_authorizationType :: (Maybe AuthorizationType -> f (Maybe AuthorizationType))
-> CreateRoute -> f CreateRoute
createRoute_authorizationType = (CreateRoute -> Maybe AuthorizationType)
-> (CreateRoute -> Maybe AuthorizationType -> CreateRoute)
-> Lens
     CreateRoute
     CreateRoute
     (Maybe AuthorizationType)
     (Maybe AuthorizationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Maybe AuthorizationType
authorizationType :: Maybe AuthorizationType
$sel:authorizationType:CreateRoute' :: CreateRoute -> Maybe AuthorizationType
authorizationType} -> Maybe AuthorizationType
authorizationType) (\s :: CreateRoute
s@CreateRoute' {} Maybe AuthorizationType
a -> CreateRoute
s {$sel:authorizationType:CreateRoute' :: Maybe AuthorizationType
authorizationType = Maybe AuthorizationType
a} :: CreateRoute)

-- | Specifies whether an API key is required for the route. Supported only
-- for WebSocket APIs.
createRoute_apiKeyRequired :: Lens.Lens' CreateRoute (Prelude.Maybe Prelude.Bool)
createRoute_apiKeyRequired :: (Maybe Bool -> f (Maybe Bool)) -> CreateRoute -> f CreateRoute
createRoute_apiKeyRequired = (CreateRoute -> Maybe Bool)
-> (CreateRoute -> Maybe Bool -> CreateRoute)
-> Lens CreateRoute CreateRoute (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Maybe Bool
apiKeyRequired :: Maybe Bool
$sel:apiKeyRequired:CreateRoute' :: CreateRoute -> Maybe Bool
apiKeyRequired} -> Maybe Bool
apiKeyRequired) (\s :: CreateRoute
s@CreateRoute' {} Maybe Bool
a -> CreateRoute
s {$sel:apiKeyRequired:CreateRoute' :: Maybe Bool
apiKeyRequired = Maybe Bool
a} :: CreateRoute)

-- | The target for the route.
createRoute_target :: Lens.Lens' CreateRoute (Prelude.Maybe Prelude.Text)
createRoute_target :: (Maybe Text -> f (Maybe Text)) -> CreateRoute -> f CreateRoute
createRoute_target = (CreateRoute -> Maybe Text)
-> (CreateRoute -> Maybe Text -> CreateRoute)
-> Lens CreateRoute CreateRoute (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Maybe Text
target :: Maybe Text
$sel:target:CreateRoute' :: CreateRoute -> Maybe Text
target} -> Maybe Text
target) (\s :: CreateRoute
s@CreateRoute' {} Maybe Text
a -> CreateRoute
s {$sel:target:CreateRoute' :: Maybe Text
target = Maybe Text
a} :: CreateRoute)

-- | The API identifier.
createRoute_apiId :: Lens.Lens' CreateRoute Prelude.Text
createRoute_apiId :: (Text -> f Text) -> CreateRoute -> f CreateRoute
createRoute_apiId = (CreateRoute -> Text)
-> (CreateRoute -> Text -> CreateRoute)
-> Lens CreateRoute CreateRoute Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Text
apiId :: Text
$sel:apiId:CreateRoute' :: CreateRoute -> Text
apiId} -> Text
apiId) (\s :: CreateRoute
s@CreateRoute' {} Text
a -> CreateRoute
s {$sel:apiId:CreateRoute' :: Text
apiId = Text
a} :: CreateRoute)

-- | The route key for the route.
createRoute_routeKey :: Lens.Lens' CreateRoute Prelude.Text
createRoute_routeKey :: (Text -> f Text) -> CreateRoute -> f CreateRoute
createRoute_routeKey = (CreateRoute -> Text)
-> (CreateRoute -> Text -> CreateRoute)
-> Lens CreateRoute CreateRoute Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Text
routeKey :: Text
$sel:routeKey:CreateRoute' :: CreateRoute -> Text
routeKey} -> Text
routeKey) (\s :: CreateRoute
s@CreateRoute' {} Text
a -> CreateRoute
s {$sel:routeKey:CreateRoute' :: Text
routeKey = Text
a} :: CreateRoute)

instance Core.AWSRequest CreateRoute where
  type AWSResponse CreateRoute = CreateRouteResponse'
  request :: CreateRoute -> Request CreateRoute
request = Service -> CreateRoute -> Request CreateRoute
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateRoute
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateRoute)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateRoute))
-> Logger
-> Service
-> Proxy CreateRoute
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateRoute)))
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 ->
          Maybe [Text]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe (HashMap Text ParameterConstraints)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe AuthorizationType
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Int
-> CreateRouteResponse'
CreateRouteResponse''
            (Maybe [Text]
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe (HashMap Text ParameterConstraints)
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe AuthorizationType
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateRouteResponse')
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text ParameterConstraints)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AuthorizationType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateRouteResponse')
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"authorizationScopes"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text ParameterConstraints)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AuthorizationType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateRouteResponse')
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text ParameterConstraints)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AuthorizationType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateRouteResponse')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"modelSelectionExpression")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text ParameterConstraints)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AuthorizationType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateRouteResponse')
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text ParameterConstraints)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AuthorizationType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateRouteResponse')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"requestModels" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text ParameterConstraints)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AuthorizationType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateRouteResponse')
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text ParameterConstraints)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AuthorizationType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateRouteResponse')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"routeResponseSelectionExpression")
            Either
  String
  (Maybe (HashMap Text ParameterConstraints)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AuthorizationType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateRouteResponse')
-> Either String (Maybe (HashMap Text ParameterConstraints))
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AuthorizationType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateRouteResponse')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either
     String (Maybe (Maybe (HashMap Text ParameterConstraints)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"requestParameters"
                            Either String (Maybe (Maybe (HashMap Text ParameterConstraints)))
-> Maybe (HashMap Text ParameterConstraints)
-> Either String (Maybe (HashMap Text ParameterConstraints))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text ParameterConstraints)
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AuthorizationType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateRouteResponse')
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AuthorizationType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateRouteResponse')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"routeId")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AuthorizationType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateRouteResponse')
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe AuthorizationType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateRouteResponse')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"authorizerId")
            Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe AuthorizationType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateRouteResponse')
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe AuthorizationType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateRouteResponse')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"operationName")
            Either
  String
  (Maybe Bool
   -> Maybe AuthorizationType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateRouteResponse')
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe AuthorizationType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateRouteResponse')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"apiGatewayManaged")
            Either
  String
  (Maybe AuthorizationType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateRouteResponse')
-> Either String (Maybe AuthorizationType)
-> Either
     String
     (Maybe Bool
      -> Maybe Text -> Maybe Text -> Int -> CreateRouteResponse')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AuthorizationType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"authorizationType")
            Either
  String
  (Maybe Bool
   -> Maybe Text -> Maybe Text -> Int -> CreateRouteResponse')
-> Either String (Maybe Bool)
-> Either
     String (Maybe Text -> Maybe Text -> Int -> CreateRouteResponse')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"apiKeyRequired")
            Either
  String (Maybe Text -> Maybe Text -> Int -> CreateRouteResponse')
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateRouteResponse')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"routeKey")
            Either String (Maybe Text -> Int -> CreateRouteResponse')
-> Either String (Maybe Text)
-> Either String (Int -> CreateRouteResponse')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"target")
            Either String (Int -> CreateRouteResponse')
-> Either String Int -> Either String CreateRouteResponse'
forall (f :: * -> *) a b. Applicative f => 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 CreateRoute

instance Prelude.NFData CreateRoute

instance Core.ToHeaders CreateRoute where
  toHeaders :: CreateRoute -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateRoute -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateRoute where
  toJSON :: CreateRoute -> Value
toJSON CreateRoute' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text ParameterConstraints)
Maybe AuthorizationType
Text
routeKey :: Text
apiId :: Text
target :: Maybe Text
apiKeyRequired :: Maybe Bool
authorizationType :: Maybe AuthorizationType
operationName :: Maybe Text
authorizerId :: Maybe Text
requestParameters :: Maybe (HashMap Text ParameterConstraints)
routeResponseSelectionExpression :: Maybe Text
requestModels :: Maybe (HashMap Text Text)
modelSelectionExpression :: Maybe Text
authorizationScopes :: Maybe [Text]
$sel:routeKey:CreateRoute' :: CreateRoute -> Text
$sel:apiId:CreateRoute' :: CreateRoute -> Text
$sel:target:CreateRoute' :: CreateRoute -> Maybe Text
$sel:apiKeyRequired:CreateRoute' :: CreateRoute -> Maybe Bool
$sel:authorizationType:CreateRoute' :: CreateRoute -> Maybe AuthorizationType
$sel:operationName:CreateRoute' :: CreateRoute -> Maybe Text
$sel:authorizerId:CreateRoute' :: CreateRoute -> Maybe Text
$sel:requestParameters:CreateRoute' :: CreateRoute -> Maybe (HashMap Text ParameterConstraints)
$sel:routeResponseSelectionExpression:CreateRoute' :: CreateRoute -> Maybe Text
$sel:requestModels:CreateRoute' :: CreateRoute -> Maybe (HashMap Text Text)
$sel:modelSelectionExpression:CreateRoute' :: CreateRoute -> Maybe Text
$sel:authorizationScopes:CreateRoute' :: CreateRoute -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"authorizationScopes" 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]
authorizationScopes,
            (Text
"modelSelectionExpression" 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
modelSelectionExpression,
            (Text
"requestModels" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
requestModels,
            (Text
"routeResponseSelectionExpression" 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
routeResponseSelectionExpression,
            (Text
"requestParameters" Text -> HashMap Text ParameterConstraints -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text ParameterConstraints -> Pair)
-> Maybe (HashMap Text ParameterConstraints) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text ParameterConstraints)
requestParameters,
            (Text
"authorizerId" 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
authorizerId,
            (Text
"operationName" 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
operationName,
            (Text
"authorizationType" Text -> AuthorizationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AuthorizationType -> Pair)
-> Maybe AuthorizationType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AuthorizationType
authorizationType,
            (Text
"apiKeyRequired" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
apiKeyRequired,
            (Text
"target" 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
target,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"routeKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
routeKey)
          ]
      )

instance Core.ToPath CreateRoute where
  toPath :: CreateRoute -> ByteString
toPath CreateRoute' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text ParameterConstraints)
Maybe AuthorizationType
Text
routeKey :: Text
apiId :: Text
target :: Maybe Text
apiKeyRequired :: Maybe Bool
authorizationType :: Maybe AuthorizationType
operationName :: Maybe Text
authorizerId :: Maybe Text
requestParameters :: Maybe (HashMap Text ParameterConstraints)
routeResponseSelectionExpression :: Maybe Text
requestModels :: Maybe (HashMap Text Text)
modelSelectionExpression :: Maybe Text
authorizationScopes :: Maybe [Text]
$sel:routeKey:CreateRoute' :: CreateRoute -> Text
$sel:apiId:CreateRoute' :: CreateRoute -> Text
$sel:target:CreateRoute' :: CreateRoute -> Maybe Text
$sel:apiKeyRequired:CreateRoute' :: CreateRoute -> Maybe Bool
$sel:authorizationType:CreateRoute' :: CreateRoute -> Maybe AuthorizationType
$sel:operationName:CreateRoute' :: CreateRoute -> Maybe Text
$sel:authorizerId:CreateRoute' :: CreateRoute -> Maybe Text
$sel:requestParameters:CreateRoute' :: CreateRoute -> Maybe (HashMap Text ParameterConstraints)
$sel:routeResponseSelectionExpression:CreateRoute' :: CreateRoute -> Maybe Text
$sel:requestModels:CreateRoute' :: CreateRoute -> Maybe (HashMap Text Text)
$sel:modelSelectionExpression:CreateRoute' :: CreateRoute -> Maybe Text
$sel:authorizationScopes:CreateRoute' :: CreateRoute -> Maybe [Text]
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v2/apis/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId, ByteString
"/routes"]

instance Core.ToQuery CreateRoute where
  toQuery :: CreateRoute -> QueryString
toQuery = QueryString -> CreateRoute -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateRouteResponse'' smart constructor.
data CreateRouteResponse' = CreateRouteResponse''
  { -- | A list of authorization scopes configured on a route. The scopes are
    -- used with a JWT authorizer to authorize the method invocation. The
    -- authorization works by matching the route scopes against the scopes
    -- parsed from the access token in the incoming request. The method
    -- invocation is authorized if any route scope matches a claimed scope in
    -- the access token. Otherwise, the invocation is not authorized. When the
    -- route scope is configured, the client must provide an access token
    -- instead of an identity token for authorization purposes.
    CreateRouteResponse' -> Maybe [Text]
authorizationScopes :: Prelude.Maybe [Prelude.Text],
    -- | The model selection expression for the route. Supported only for
    -- WebSocket APIs.
    CreateRouteResponse' -> Maybe Text
modelSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | The request models for the route. Supported only for WebSocket APIs.
    CreateRouteResponse' -> Maybe (HashMap Text Text)
requestModels :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The route response selection expression for the route. Supported only
    -- for WebSocket APIs.
    CreateRouteResponse' -> Maybe Text
routeResponseSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | The request parameters for the route. Supported only for WebSocket APIs.
    CreateRouteResponse' -> Maybe (HashMap Text ParameterConstraints)
requestParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text ParameterConstraints),
    -- | The route ID.
    CreateRouteResponse' -> Maybe Text
routeId :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the Authorizer resource to be associated with this
    -- route. The authorizer identifier is generated by API Gateway when you
    -- created the authorizer.
    CreateRouteResponse' -> Maybe Text
authorizerId :: Prelude.Maybe Prelude.Text,
    -- | The operation name for the route.
    CreateRouteResponse' -> Maybe Text
operationName :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether a route is managed by API Gateway. If you created an
    -- API using quick create, the $default route is managed by API Gateway.
    -- You can\'t modify the $default route key.
    CreateRouteResponse' -> Maybe Bool
apiGatewayManaged :: Prelude.Maybe Prelude.Bool,
    -- | The authorization type for the route. For WebSocket APIs, valid values
    -- are NONE for open access, AWS_IAM for using AWS IAM permissions, and
    -- CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are
    -- NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using
    -- AWS IAM permissions, and CUSTOM for using a Lambda authorizer.
    CreateRouteResponse' -> Maybe AuthorizationType
authorizationType :: Prelude.Maybe AuthorizationType,
    -- | Specifies whether an API key is required for this route. Supported only
    -- for WebSocket APIs.
    CreateRouteResponse' -> Maybe Bool
apiKeyRequired :: Prelude.Maybe Prelude.Bool,
    -- | The route key for the route.
    CreateRouteResponse' -> Maybe Text
routeKey :: Prelude.Maybe Prelude.Text,
    -- | The target for the route.
    CreateRouteResponse' -> Maybe Text
target :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateRouteResponse' -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateRouteResponse' -> CreateRouteResponse' -> Bool
(CreateRouteResponse' -> CreateRouteResponse' -> Bool)
-> (CreateRouteResponse' -> CreateRouteResponse' -> Bool)
-> Eq CreateRouteResponse'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRouteResponse' -> CreateRouteResponse' -> Bool
$c/= :: CreateRouteResponse' -> CreateRouteResponse' -> Bool
== :: CreateRouteResponse' -> CreateRouteResponse' -> Bool
$c== :: CreateRouteResponse' -> CreateRouteResponse' -> Bool
Prelude.Eq, ReadPrec [CreateRouteResponse']
ReadPrec CreateRouteResponse'
Int -> ReadS CreateRouteResponse'
ReadS [CreateRouteResponse']
(Int -> ReadS CreateRouteResponse')
-> ReadS [CreateRouteResponse']
-> ReadPrec CreateRouteResponse'
-> ReadPrec [CreateRouteResponse']
-> Read CreateRouteResponse'
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRouteResponse']
$creadListPrec :: ReadPrec [CreateRouteResponse']
readPrec :: ReadPrec CreateRouteResponse'
$creadPrec :: ReadPrec CreateRouteResponse'
readList :: ReadS [CreateRouteResponse']
$creadList :: ReadS [CreateRouteResponse']
readsPrec :: Int -> ReadS CreateRouteResponse'
$creadsPrec :: Int -> ReadS CreateRouteResponse'
Prelude.Read, Int -> CreateRouteResponse' -> ShowS
[CreateRouteResponse'] -> ShowS
CreateRouteResponse' -> String
(Int -> CreateRouteResponse' -> ShowS)
-> (CreateRouteResponse' -> String)
-> ([CreateRouteResponse'] -> ShowS)
-> Show CreateRouteResponse'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRouteResponse'] -> ShowS
$cshowList :: [CreateRouteResponse'] -> ShowS
show :: CreateRouteResponse' -> String
$cshow :: CreateRouteResponse' -> String
showsPrec :: Int -> CreateRouteResponse' -> ShowS
$cshowsPrec :: Int -> CreateRouteResponse' -> ShowS
Prelude.Show, (forall x. CreateRouteResponse' -> Rep CreateRouteResponse' x)
-> (forall x. Rep CreateRouteResponse' x -> CreateRouteResponse')
-> Generic CreateRouteResponse'
forall x. Rep CreateRouteResponse' x -> CreateRouteResponse'
forall x. CreateRouteResponse' -> Rep CreateRouteResponse' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateRouteResponse' x -> CreateRouteResponse'
$cfrom :: forall x. CreateRouteResponse' -> Rep CreateRouteResponse' x
Prelude.Generic)

-- |
-- Create a value of 'CreateRouteResponse'' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'authorizationScopes', 'createRouteResponse'_authorizationScopes' - A list of authorization scopes configured on a route. The scopes are
-- used with a JWT authorizer to authorize the method invocation. The
-- authorization works by matching the route scopes against the scopes
-- parsed from the access token in the incoming request. The method
-- invocation is authorized if any route scope matches a claimed scope in
-- the access token. Otherwise, the invocation is not authorized. When the
-- route scope is configured, the client must provide an access token
-- instead of an identity token for authorization purposes.
--
-- 'modelSelectionExpression', 'createRouteResponse'_modelSelectionExpression' - The model selection expression for the route. Supported only for
-- WebSocket APIs.
--
-- 'requestModels', 'createRouteResponse'_requestModels' - The request models for the route. Supported only for WebSocket APIs.
--
-- 'routeResponseSelectionExpression', 'createRouteResponse'_routeResponseSelectionExpression' - The route response selection expression for the route. Supported only
-- for WebSocket APIs.
--
-- 'requestParameters', 'createRouteResponse'_requestParameters' - The request parameters for the route. Supported only for WebSocket APIs.
--
-- 'routeId', 'createRouteResponse'_routeId' - The route ID.
--
-- 'authorizerId', 'createRouteResponse'_authorizerId' - The identifier of the Authorizer resource to be associated with this
-- route. The authorizer identifier is generated by API Gateway when you
-- created the authorizer.
--
-- 'operationName', 'createRouteResponse'_operationName' - The operation name for the route.
--
-- 'apiGatewayManaged', 'createRouteResponse'_apiGatewayManaged' - Specifies whether a route is managed by API Gateway. If you created an
-- API using quick create, the $default route is managed by API Gateway.
-- You can\'t modify the $default route key.
--
-- 'authorizationType', 'createRouteResponse'_authorizationType' - The authorization type for the route. For WebSocket APIs, valid values
-- are NONE for open access, AWS_IAM for using AWS IAM permissions, and
-- CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are
-- NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using
-- AWS IAM permissions, and CUSTOM for using a Lambda authorizer.
--
-- 'apiKeyRequired', 'createRouteResponse'_apiKeyRequired' - Specifies whether an API key is required for this route. Supported only
-- for WebSocket APIs.
--
-- 'routeKey', 'createRouteResponse'_routeKey' - The route key for the route.
--
-- 'target', 'createRouteResponse'_target' - The target for the route.
--
-- 'httpStatus', 'createRouteResponse'_httpStatus' - The response's http status code.
newCreateRouteResponse' ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateRouteResponse'
newCreateRouteResponse' :: Int -> CreateRouteResponse'
newCreateRouteResponse' Int
pHttpStatus_ =
  CreateRouteResponse'' :: Maybe [Text]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe (HashMap Text ParameterConstraints)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe AuthorizationType
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Int
-> CreateRouteResponse'
CreateRouteResponse''
    { $sel:authorizationScopes:CreateRouteResponse'' :: Maybe [Text]
authorizationScopes =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:modelSelectionExpression:CreateRouteResponse'' :: Maybe Text
modelSelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:requestModels:CreateRouteResponse'' :: Maybe (HashMap Text Text)
requestModels = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:routeResponseSelectionExpression:CreateRouteResponse'' :: Maybe Text
routeResponseSelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:requestParameters:CreateRouteResponse'' :: Maybe (HashMap Text ParameterConstraints)
requestParameters = Maybe (HashMap Text ParameterConstraints)
forall a. Maybe a
Prelude.Nothing,
      $sel:routeId:CreateRouteResponse'' :: Maybe Text
routeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerId:CreateRouteResponse'' :: Maybe Text
authorizerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operationName:CreateRouteResponse'' :: Maybe Text
operationName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiGatewayManaged:CreateRouteResponse'' :: Maybe Bool
apiGatewayManaged = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizationType:CreateRouteResponse'' :: Maybe AuthorizationType
authorizationType = Maybe AuthorizationType
forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeyRequired:CreateRouteResponse'' :: Maybe Bool
apiKeyRequired = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:routeKey:CreateRouteResponse'' :: Maybe Text
routeKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:target:CreateRouteResponse'' :: Maybe Text
target = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateRouteResponse'' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of authorization scopes configured on a route. The scopes are
-- used with a JWT authorizer to authorize the method invocation. The
-- authorization works by matching the route scopes against the scopes
-- parsed from the access token in the incoming request. The method
-- invocation is authorized if any route scope matches a claimed scope in
-- the access token. Otherwise, the invocation is not authorized. When the
-- route scope is configured, the client must provide an access token
-- instead of an identity token for authorization purposes.
createRouteResponse'_authorizationScopes :: Lens.Lens' CreateRouteResponse' (Prelude.Maybe [Prelude.Text])
createRouteResponse'_authorizationScopes :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_authorizationScopes = (CreateRouteResponse' -> Maybe [Text])
-> (CreateRouteResponse' -> Maybe [Text] -> CreateRouteResponse')
-> Lens
     CreateRouteResponse'
     CreateRouteResponse'
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Maybe [Text]
authorizationScopes :: Maybe [Text]
$sel:authorizationScopes:CreateRouteResponse'' :: CreateRouteResponse' -> Maybe [Text]
authorizationScopes} -> Maybe [Text]
authorizationScopes) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Maybe [Text]
a -> CreateRouteResponse'
s {$sel:authorizationScopes:CreateRouteResponse'' :: Maybe [Text]
authorizationScopes = Maybe [Text]
a} :: CreateRouteResponse') ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateRouteResponse' -> f CreateRouteResponse')
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateRouteResponse'
-> f CreateRouteResponse'
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

-- | The model selection expression for the route. Supported only for
-- WebSocket APIs.
createRouteResponse'_modelSelectionExpression :: Lens.Lens' CreateRouteResponse' (Prelude.Maybe Prelude.Text)
createRouteResponse'_modelSelectionExpression :: (Maybe Text -> f (Maybe Text))
-> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_modelSelectionExpression = (CreateRouteResponse' -> Maybe Text)
-> (CreateRouteResponse' -> Maybe Text -> CreateRouteResponse')
-> Lens
     CreateRouteResponse' CreateRouteResponse' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Maybe Text
modelSelectionExpression :: Maybe Text
$sel:modelSelectionExpression:CreateRouteResponse'' :: CreateRouteResponse' -> Maybe Text
modelSelectionExpression} -> Maybe Text
modelSelectionExpression) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Maybe Text
a -> CreateRouteResponse'
s {$sel:modelSelectionExpression:CreateRouteResponse'' :: Maybe Text
modelSelectionExpression = Maybe Text
a} :: CreateRouteResponse')

-- | The request models for the route. Supported only for WebSocket APIs.
createRouteResponse'_requestModels :: Lens.Lens' CreateRouteResponse' (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createRouteResponse'_requestModels :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_requestModels = (CreateRouteResponse' -> Maybe (HashMap Text Text))
-> (CreateRouteResponse'
    -> Maybe (HashMap Text Text) -> CreateRouteResponse')
-> Lens
     CreateRouteResponse'
     CreateRouteResponse'
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Maybe (HashMap Text Text)
requestModels :: Maybe (HashMap Text Text)
$sel:requestModels:CreateRouteResponse'' :: CreateRouteResponse' -> Maybe (HashMap Text Text)
requestModels} -> Maybe (HashMap Text Text)
requestModels) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Maybe (HashMap Text Text)
a -> CreateRouteResponse'
s {$sel:requestModels:CreateRouteResponse'' :: Maybe (HashMap Text Text)
requestModels = Maybe (HashMap Text Text)
a} :: CreateRouteResponse') ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateRouteResponse' -> f CreateRouteResponse')
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateRouteResponse'
-> f CreateRouteResponse'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The route response selection expression for the route. Supported only
-- for WebSocket APIs.
createRouteResponse'_routeResponseSelectionExpression :: Lens.Lens' CreateRouteResponse' (Prelude.Maybe Prelude.Text)
createRouteResponse'_routeResponseSelectionExpression :: (Maybe Text -> f (Maybe Text))
-> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_routeResponseSelectionExpression = (CreateRouteResponse' -> Maybe Text)
-> (CreateRouteResponse' -> Maybe Text -> CreateRouteResponse')
-> Lens
     CreateRouteResponse' CreateRouteResponse' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Maybe Text
routeResponseSelectionExpression :: Maybe Text
$sel:routeResponseSelectionExpression:CreateRouteResponse'' :: CreateRouteResponse' -> Maybe Text
routeResponseSelectionExpression} -> Maybe Text
routeResponseSelectionExpression) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Maybe Text
a -> CreateRouteResponse'
s {$sel:routeResponseSelectionExpression:CreateRouteResponse'' :: Maybe Text
routeResponseSelectionExpression = Maybe Text
a} :: CreateRouteResponse')

-- | The request parameters for the route. Supported only for WebSocket APIs.
createRouteResponse'_requestParameters :: Lens.Lens' CreateRouteResponse' (Prelude.Maybe (Prelude.HashMap Prelude.Text ParameterConstraints))
createRouteResponse'_requestParameters :: (Maybe (HashMap Text ParameterConstraints)
 -> f (Maybe (HashMap Text ParameterConstraints)))
-> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_requestParameters = (CreateRouteResponse' -> Maybe (HashMap Text ParameterConstraints))
-> (CreateRouteResponse'
    -> Maybe (HashMap Text ParameterConstraints)
    -> CreateRouteResponse')
-> Lens
     CreateRouteResponse'
     CreateRouteResponse'
     (Maybe (HashMap Text ParameterConstraints))
     (Maybe (HashMap Text ParameterConstraints))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Maybe (HashMap Text ParameterConstraints)
requestParameters :: Maybe (HashMap Text ParameterConstraints)
$sel:requestParameters:CreateRouteResponse'' :: CreateRouteResponse' -> Maybe (HashMap Text ParameterConstraints)
requestParameters} -> Maybe (HashMap Text ParameterConstraints)
requestParameters) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Maybe (HashMap Text ParameterConstraints)
a -> CreateRouteResponse'
s {$sel:requestParameters:CreateRouteResponse'' :: Maybe (HashMap Text ParameterConstraints)
requestParameters = Maybe (HashMap Text ParameterConstraints)
a} :: CreateRouteResponse') ((Maybe (HashMap Text ParameterConstraints)
  -> f (Maybe (HashMap Text ParameterConstraints)))
 -> CreateRouteResponse' -> f CreateRouteResponse')
-> ((Maybe (HashMap Text ParameterConstraints)
     -> f (Maybe (HashMap Text ParameterConstraints)))
    -> Maybe (HashMap Text ParameterConstraints)
    -> f (Maybe (HashMap Text ParameterConstraints)))
-> (Maybe (HashMap Text ParameterConstraints)
    -> f (Maybe (HashMap Text ParameterConstraints)))
-> CreateRouteResponse'
-> f CreateRouteResponse'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text ParameterConstraints)
  (HashMap Text ParameterConstraints)
  (HashMap Text ParameterConstraints)
  (HashMap Text ParameterConstraints)
-> Iso
     (Maybe (HashMap Text ParameterConstraints))
     (Maybe (HashMap Text ParameterConstraints))
     (Maybe (HashMap Text ParameterConstraints))
     (Maybe (HashMap Text ParameterConstraints))
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
  (HashMap Text ParameterConstraints)
  (HashMap Text ParameterConstraints)
  (HashMap Text ParameterConstraints)
  (HashMap Text ParameterConstraints)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The route ID.
createRouteResponse'_routeId :: Lens.Lens' CreateRouteResponse' (Prelude.Maybe Prelude.Text)
createRouteResponse'_routeId :: (Maybe Text -> f (Maybe Text))
-> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_routeId = (CreateRouteResponse' -> Maybe Text)
-> (CreateRouteResponse' -> Maybe Text -> CreateRouteResponse')
-> Lens
     CreateRouteResponse' CreateRouteResponse' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Maybe Text
routeId :: Maybe Text
$sel:routeId:CreateRouteResponse'' :: CreateRouteResponse' -> Maybe Text
routeId} -> Maybe Text
routeId) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Maybe Text
a -> CreateRouteResponse'
s {$sel:routeId:CreateRouteResponse'' :: Maybe Text
routeId = Maybe Text
a} :: CreateRouteResponse')

-- | The identifier of the Authorizer resource to be associated with this
-- route. The authorizer identifier is generated by API Gateway when you
-- created the authorizer.
createRouteResponse'_authorizerId :: Lens.Lens' CreateRouteResponse' (Prelude.Maybe Prelude.Text)
createRouteResponse'_authorizerId :: (Maybe Text -> f (Maybe Text))
-> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_authorizerId = (CreateRouteResponse' -> Maybe Text)
-> (CreateRouteResponse' -> Maybe Text -> CreateRouteResponse')
-> Lens
     CreateRouteResponse' CreateRouteResponse' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Maybe Text
authorizerId :: Maybe Text
$sel:authorizerId:CreateRouteResponse'' :: CreateRouteResponse' -> Maybe Text
authorizerId} -> Maybe Text
authorizerId) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Maybe Text
a -> CreateRouteResponse'
s {$sel:authorizerId:CreateRouteResponse'' :: Maybe Text
authorizerId = Maybe Text
a} :: CreateRouteResponse')

-- | The operation name for the route.
createRouteResponse'_operationName :: Lens.Lens' CreateRouteResponse' (Prelude.Maybe Prelude.Text)
createRouteResponse'_operationName :: (Maybe Text -> f (Maybe Text))
-> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_operationName = (CreateRouteResponse' -> Maybe Text)
-> (CreateRouteResponse' -> Maybe Text -> CreateRouteResponse')
-> Lens
     CreateRouteResponse' CreateRouteResponse' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Maybe Text
operationName :: Maybe Text
$sel:operationName:CreateRouteResponse'' :: CreateRouteResponse' -> Maybe Text
operationName} -> Maybe Text
operationName) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Maybe Text
a -> CreateRouteResponse'
s {$sel:operationName:CreateRouteResponse'' :: Maybe Text
operationName = Maybe Text
a} :: CreateRouteResponse')

-- | Specifies whether a route is managed by API Gateway. If you created an
-- API using quick create, the $default route is managed by API Gateway.
-- You can\'t modify the $default route key.
createRouteResponse'_apiGatewayManaged :: Lens.Lens' CreateRouteResponse' (Prelude.Maybe Prelude.Bool)
createRouteResponse'_apiGatewayManaged :: (Maybe Bool -> f (Maybe Bool))
-> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_apiGatewayManaged = (CreateRouteResponse' -> Maybe Bool)
-> (CreateRouteResponse' -> Maybe Bool -> CreateRouteResponse')
-> Lens
     CreateRouteResponse' CreateRouteResponse' (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Maybe Bool
apiGatewayManaged :: Maybe Bool
$sel:apiGatewayManaged:CreateRouteResponse'' :: CreateRouteResponse' -> Maybe Bool
apiGatewayManaged} -> Maybe Bool
apiGatewayManaged) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Maybe Bool
a -> CreateRouteResponse'
s {$sel:apiGatewayManaged:CreateRouteResponse'' :: Maybe Bool
apiGatewayManaged = Maybe Bool
a} :: CreateRouteResponse')

-- | The authorization type for the route. For WebSocket APIs, valid values
-- are NONE for open access, AWS_IAM for using AWS IAM permissions, and
-- CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are
-- NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using
-- AWS IAM permissions, and CUSTOM for using a Lambda authorizer.
createRouteResponse'_authorizationType :: Lens.Lens' CreateRouteResponse' (Prelude.Maybe AuthorizationType)
createRouteResponse'_authorizationType :: (Maybe AuthorizationType -> f (Maybe AuthorizationType))
-> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_authorizationType = (CreateRouteResponse' -> Maybe AuthorizationType)
-> (CreateRouteResponse'
    -> Maybe AuthorizationType -> CreateRouteResponse')
-> Lens
     CreateRouteResponse'
     CreateRouteResponse'
     (Maybe AuthorizationType)
     (Maybe AuthorizationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Maybe AuthorizationType
authorizationType :: Maybe AuthorizationType
$sel:authorizationType:CreateRouteResponse'' :: CreateRouteResponse' -> Maybe AuthorizationType
authorizationType} -> Maybe AuthorizationType
authorizationType) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Maybe AuthorizationType
a -> CreateRouteResponse'
s {$sel:authorizationType:CreateRouteResponse'' :: Maybe AuthorizationType
authorizationType = Maybe AuthorizationType
a} :: CreateRouteResponse')

-- | Specifies whether an API key is required for this route. Supported only
-- for WebSocket APIs.
createRouteResponse'_apiKeyRequired :: Lens.Lens' CreateRouteResponse' (Prelude.Maybe Prelude.Bool)
createRouteResponse'_apiKeyRequired :: (Maybe Bool -> f (Maybe Bool))
-> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_apiKeyRequired = (CreateRouteResponse' -> Maybe Bool)
-> (CreateRouteResponse' -> Maybe Bool -> CreateRouteResponse')
-> Lens
     CreateRouteResponse' CreateRouteResponse' (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Maybe Bool
apiKeyRequired :: Maybe Bool
$sel:apiKeyRequired:CreateRouteResponse'' :: CreateRouteResponse' -> Maybe Bool
apiKeyRequired} -> Maybe Bool
apiKeyRequired) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Maybe Bool
a -> CreateRouteResponse'
s {$sel:apiKeyRequired:CreateRouteResponse'' :: Maybe Bool
apiKeyRequired = Maybe Bool
a} :: CreateRouteResponse')

-- | The route key for the route.
createRouteResponse'_routeKey :: Lens.Lens' CreateRouteResponse' (Prelude.Maybe Prelude.Text)
createRouteResponse'_routeKey :: (Maybe Text -> f (Maybe Text))
-> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_routeKey = (CreateRouteResponse' -> Maybe Text)
-> (CreateRouteResponse' -> Maybe Text -> CreateRouteResponse')
-> Lens
     CreateRouteResponse' CreateRouteResponse' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Maybe Text
routeKey :: Maybe Text
$sel:routeKey:CreateRouteResponse'' :: CreateRouteResponse' -> Maybe Text
routeKey} -> Maybe Text
routeKey) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Maybe Text
a -> CreateRouteResponse'
s {$sel:routeKey:CreateRouteResponse'' :: Maybe Text
routeKey = Maybe Text
a} :: CreateRouteResponse')

-- | The target for the route.
createRouteResponse'_target :: Lens.Lens' CreateRouteResponse' (Prelude.Maybe Prelude.Text)
createRouteResponse'_target :: (Maybe Text -> f (Maybe Text))
-> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_target = (CreateRouteResponse' -> Maybe Text)
-> (CreateRouteResponse' -> Maybe Text -> CreateRouteResponse')
-> Lens
     CreateRouteResponse' CreateRouteResponse' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Maybe Text
target :: Maybe Text
$sel:target:CreateRouteResponse'' :: CreateRouteResponse' -> Maybe Text
target} -> Maybe Text
target) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Maybe Text
a -> CreateRouteResponse'
s {$sel:target:CreateRouteResponse'' :: Maybe Text
target = Maybe Text
a} :: CreateRouteResponse')

-- | The response's http status code.
createRouteResponse'_httpStatus :: Lens.Lens' CreateRouteResponse' Prelude.Int
createRouteResponse'_httpStatus :: (Int -> f Int) -> CreateRouteResponse' -> f CreateRouteResponse'
createRouteResponse'_httpStatus = (CreateRouteResponse' -> Int)
-> (CreateRouteResponse' -> Int -> CreateRouteResponse')
-> Lens CreateRouteResponse' CreateRouteResponse' Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse'' {Int
httpStatus :: Int
$sel:httpStatus:CreateRouteResponse'' :: CreateRouteResponse' -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateRouteResponse'
s@CreateRouteResponse'' {} Int
a -> CreateRouteResponse'
s {$sel:httpStatus:CreateRouteResponse'' :: Int
httpStatus = Int
a} :: CreateRouteResponse')

instance Prelude.NFData CreateRouteResponse'