{-# 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.GetRoute
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets a Route.
module Amazonka.ApiGatewayV2.GetRoute
  ( -- * Creating a Request
    GetRoute (..),
    newGetRoute,

    -- * Request Lenses
    getRoute_apiId,
    getRoute_routeId,

    -- * Destructuring the Response
    GetRouteResponse' (..),
    newGetRouteResponse',

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

import Amazonka.ApiGatewayV2.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetRoute' smart constructor.
data GetRoute = GetRoute'
  { -- | The API identifier.
    GetRoute -> Text
apiId :: Prelude.Text,
    -- | The route ID.
    GetRoute -> Text
routeId :: Prelude.Text
  }
  deriving (GetRoute -> GetRoute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRoute -> GetRoute -> Bool
$c/= :: GetRoute -> GetRoute -> Bool
== :: GetRoute -> GetRoute -> Bool
$c== :: GetRoute -> GetRoute -> Bool
Prelude.Eq, ReadPrec [GetRoute]
ReadPrec GetRoute
Int -> ReadS GetRoute
ReadS [GetRoute]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRoute]
$creadListPrec :: ReadPrec [GetRoute]
readPrec :: ReadPrec GetRoute
$creadPrec :: ReadPrec GetRoute
readList :: ReadS [GetRoute]
$creadList :: ReadS [GetRoute]
readsPrec :: Int -> ReadS GetRoute
$creadsPrec :: Int -> ReadS GetRoute
Prelude.Read, Int -> GetRoute -> ShowS
[GetRoute] -> ShowS
GetRoute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRoute] -> ShowS
$cshowList :: [GetRoute] -> ShowS
show :: GetRoute -> String
$cshow :: GetRoute -> String
showsPrec :: Int -> GetRoute -> ShowS
$cshowsPrec :: Int -> GetRoute -> ShowS
Prelude.Show, forall x. Rep GetRoute x -> GetRoute
forall x. GetRoute -> Rep GetRoute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetRoute x -> GetRoute
$cfrom :: forall x. GetRoute -> Rep GetRoute x
Prelude.Generic)

-- |
-- Create a value of 'GetRoute' 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:
--
-- 'apiId', 'getRoute_apiId' - The API identifier.
--
-- 'routeId', 'getRoute_routeId' - The route ID.
newGetRoute ::
  -- | 'apiId'
  Prelude.Text ->
  -- | 'routeId'
  Prelude.Text ->
  GetRoute
newGetRoute :: Text -> Text -> GetRoute
newGetRoute Text
pApiId_ Text
pRouteId_ =
  GetRoute' {$sel:apiId:GetRoute' :: Text
apiId = Text
pApiId_, $sel:routeId:GetRoute' :: Text
routeId = Text
pRouteId_}

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

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

instance Core.AWSRequest GetRoute where
  type AWSResponse GetRoute = GetRouteResponse'
  request :: (Service -> Service) -> GetRoute -> Request GetRoute
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetRoute
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetRoute)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe [Text]
-> Maybe AuthorizationType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text ParameterConstraints)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetRouteResponse'
GetRouteResponse''
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"apiGatewayManaged")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"apiKeyRequired")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"authorizationScopes"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"authorizationType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"authorizerId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"modelSelectionExpression")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"operationName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"requestModels" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"requestParameters"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"routeId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"routeKey")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"routeResponseSelectionExpression")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"target")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetRoute where
  hashWithSalt :: Int -> GetRoute -> Int
hashWithSalt Int
_salt GetRoute' {Text
routeId :: Text
apiId :: Text
$sel:routeId:GetRoute' :: GetRoute -> Text
$sel:apiId:GetRoute' :: GetRoute -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
apiId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
routeId

instance Prelude.NFData GetRoute where
  rnf :: GetRoute -> ()
rnf GetRoute' {Text
routeId :: Text
apiId :: Text
$sel:routeId:GetRoute' :: GetRoute -> Text
$sel:apiId:GetRoute' :: GetRoute -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
apiId seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
routeId

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

instance Data.ToPath GetRoute where
  toPath :: GetRoute -> ByteString
toPath GetRoute' {Text
routeId :: Text
apiId :: Text
$sel:routeId:GetRoute' :: GetRoute -> Text
$sel:apiId:GetRoute' :: GetRoute -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v2/apis/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
apiId,
        ByteString
"/routes/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
routeId
      ]

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

-- | /See:/ 'newGetRouteResponse'' smart constructor.
data GetRouteResponse' = GetRouteResponse''
  { -- | 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.
    GetRouteResponse' -> Maybe Bool
apiGatewayManaged :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether an API key is required for this route. Supported only
    -- for WebSocket APIs.
    GetRouteResponse' -> Maybe Bool
apiKeyRequired :: Prelude.Maybe Prelude.Bool,
    -- | 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.
    GetRouteResponse' -> Maybe [Text]
authorizationScopes :: 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.
    GetRouteResponse' -> Maybe AuthorizationType
authorizationType :: Prelude.Maybe AuthorizationType,
    -- | 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.
    GetRouteResponse' -> Maybe Text
authorizerId :: Prelude.Maybe Prelude.Text,
    -- | The model selection expression for the route. Supported only for
    -- WebSocket APIs.
    GetRouteResponse' -> Maybe Text
modelSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | The operation name for the route.
    GetRouteResponse' -> Maybe Text
operationName :: Prelude.Maybe Prelude.Text,
    -- | The request models for the route. Supported only for WebSocket APIs.
    GetRouteResponse' -> Maybe (HashMap Text Text)
requestModels :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The request parameters for the route. Supported only for WebSocket APIs.
    GetRouteResponse' -> Maybe (HashMap Text ParameterConstraints)
requestParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text ParameterConstraints),
    -- | The route ID.
    GetRouteResponse' -> Maybe Text
routeId :: Prelude.Maybe Prelude.Text,
    -- | The route key for the route.
    GetRouteResponse' -> Maybe Text
routeKey :: Prelude.Maybe Prelude.Text,
    -- | The route response selection expression for the route. Supported only
    -- for WebSocket APIs.
    GetRouteResponse' -> Maybe Text
routeResponseSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | The target for the route.
    GetRouteResponse' -> Maybe Text
target :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetRouteResponse' -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetRouteResponse' -> GetRouteResponse' -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRouteResponse' -> GetRouteResponse' -> Bool
$c/= :: GetRouteResponse' -> GetRouteResponse' -> Bool
== :: GetRouteResponse' -> GetRouteResponse' -> Bool
$c== :: GetRouteResponse' -> GetRouteResponse' -> Bool
Prelude.Eq, ReadPrec [GetRouteResponse']
ReadPrec GetRouteResponse'
Int -> ReadS GetRouteResponse'
ReadS [GetRouteResponse']
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRouteResponse']
$creadListPrec :: ReadPrec [GetRouteResponse']
readPrec :: ReadPrec GetRouteResponse'
$creadPrec :: ReadPrec GetRouteResponse'
readList :: ReadS [GetRouteResponse']
$creadList :: ReadS [GetRouteResponse']
readsPrec :: Int -> ReadS GetRouteResponse'
$creadsPrec :: Int -> ReadS GetRouteResponse'
Prelude.Read, Int -> GetRouteResponse' -> ShowS
[GetRouteResponse'] -> ShowS
GetRouteResponse' -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRouteResponse'] -> ShowS
$cshowList :: [GetRouteResponse'] -> ShowS
show :: GetRouteResponse' -> String
$cshow :: GetRouteResponse' -> String
showsPrec :: Int -> GetRouteResponse' -> ShowS
$cshowsPrec :: Int -> GetRouteResponse' -> ShowS
Prelude.Show, forall x. Rep GetRouteResponse' x -> GetRouteResponse'
forall x. GetRouteResponse' -> Rep GetRouteResponse' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetRouteResponse' x -> GetRouteResponse'
$cfrom :: forall x. GetRouteResponse' -> Rep GetRouteResponse' x
Prelude.Generic)

-- |
-- Create a value of 'GetRouteResponse'' 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:
--
-- 'apiGatewayManaged', 'getRouteResponse'_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.
--
-- 'apiKeyRequired', 'getRouteResponse'_apiKeyRequired' - Specifies whether an API key is required for this route. Supported only
-- for WebSocket APIs.
--
-- 'authorizationScopes', 'getRouteResponse'_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.
--
-- 'authorizationType', 'getRouteResponse'_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.
--
-- 'authorizerId', 'getRouteResponse'_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.
--
-- 'modelSelectionExpression', 'getRouteResponse'_modelSelectionExpression' - The model selection expression for the route. Supported only for
-- WebSocket APIs.
--
-- 'operationName', 'getRouteResponse'_operationName' - The operation name for the route.
--
-- 'requestModels', 'getRouteResponse'_requestModels' - The request models for the route. Supported only for WebSocket APIs.
--
-- 'requestParameters', 'getRouteResponse'_requestParameters' - The request parameters for the route. Supported only for WebSocket APIs.
--
-- 'routeId', 'getRouteResponse'_routeId' - The route ID.
--
-- 'routeKey', 'getRouteResponse'_routeKey' - The route key for the route.
--
-- 'routeResponseSelectionExpression', 'getRouteResponse'_routeResponseSelectionExpression' - The route response selection expression for the route. Supported only
-- for WebSocket APIs.
--
-- 'target', 'getRouteResponse'_target' - The target for the route.
--
-- 'httpStatus', 'getRouteResponse'_httpStatus' - The response's http status code.
newGetRouteResponse' ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRouteResponse'
newGetRouteResponse' :: Int -> GetRouteResponse'
newGetRouteResponse' Int
pHttpStatus_ =
  GetRouteResponse''
    { $sel:apiGatewayManaged:GetRouteResponse'' :: Maybe Bool
apiGatewayManaged =
        forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeyRequired:GetRouteResponse'' :: Maybe Bool
apiKeyRequired = forall a. Maybe a
Prelude.Nothing,
      $sel:authorizationScopes:GetRouteResponse'' :: Maybe [Text]
authorizationScopes = forall a. Maybe a
Prelude.Nothing,
      $sel:authorizationType:GetRouteResponse'' :: Maybe AuthorizationType
authorizationType = forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerId:GetRouteResponse'' :: Maybe Text
authorizerId = forall a. Maybe a
Prelude.Nothing,
      $sel:modelSelectionExpression:GetRouteResponse'' :: Maybe Text
modelSelectionExpression = forall a. Maybe a
Prelude.Nothing,
      $sel:operationName:GetRouteResponse'' :: Maybe Text
operationName = forall a. Maybe a
Prelude.Nothing,
      $sel:requestModels:GetRouteResponse'' :: Maybe (HashMap Text Text)
requestModels = forall a. Maybe a
Prelude.Nothing,
      $sel:requestParameters:GetRouteResponse'' :: Maybe (HashMap Text ParameterConstraints)
requestParameters = forall a. Maybe a
Prelude.Nothing,
      $sel:routeId:GetRouteResponse'' :: Maybe Text
routeId = forall a. Maybe a
Prelude.Nothing,
      $sel:routeKey:GetRouteResponse'' :: Maybe Text
routeKey = forall a. Maybe a
Prelude.Nothing,
      $sel:routeResponseSelectionExpression:GetRouteResponse'' :: Maybe Text
routeResponseSelectionExpression = forall a. Maybe a
Prelude.Nothing,
      $sel:target:GetRouteResponse'' :: Maybe Text
target = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetRouteResponse'' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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.
getRouteResponse'_apiGatewayManaged :: Lens.Lens' GetRouteResponse' (Prelude.Maybe Prelude.Bool)
getRouteResponse'_apiGatewayManaged :: Lens' GetRouteResponse' (Maybe Bool)
getRouteResponse'_apiGatewayManaged = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRouteResponse'' {Maybe Bool
apiGatewayManaged :: Maybe Bool
$sel:apiGatewayManaged:GetRouteResponse'' :: GetRouteResponse' -> Maybe Bool
apiGatewayManaged} -> Maybe Bool
apiGatewayManaged) (\s :: GetRouteResponse'
s@GetRouteResponse'' {} Maybe Bool
a -> GetRouteResponse'
s {$sel:apiGatewayManaged:GetRouteResponse'' :: Maybe Bool
apiGatewayManaged = Maybe Bool
a} :: GetRouteResponse')

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

-- | 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.
getRouteResponse'_authorizationScopes :: Lens.Lens' GetRouteResponse' (Prelude.Maybe [Prelude.Text])
getRouteResponse'_authorizationScopes :: Lens' GetRouteResponse' (Maybe [Text])
getRouteResponse'_authorizationScopes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRouteResponse'' {Maybe [Text]
authorizationScopes :: Maybe [Text]
$sel:authorizationScopes:GetRouteResponse'' :: GetRouteResponse' -> Maybe [Text]
authorizationScopes} -> Maybe [Text]
authorizationScopes) (\s :: GetRouteResponse'
s@GetRouteResponse'' {} Maybe [Text]
a -> GetRouteResponse'
s {$sel:authorizationScopes:GetRouteResponse'' :: Maybe [Text]
authorizationScopes = Maybe [Text]
a} :: GetRouteResponse') forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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.
getRouteResponse'_authorizationType :: Lens.Lens' GetRouteResponse' (Prelude.Maybe AuthorizationType)
getRouteResponse'_authorizationType :: Lens' GetRouteResponse' (Maybe AuthorizationType)
getRouteResponse'_authorizationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRouteResponse'' {Maybe AuthorizationType
authorizationType :: Maybe AuthorizationType
$sel:authorizationType:GetRouteResponse'' :: GetRouteResponse' -> Maybe AuthorizationType
authorizationType} -> Maybe AuthorizationType
authorizationType) (\s :: GetRouteResponse'
s@GetRouteResponse'' {} Maybe AuthorizationType
a -> GetRouteResponse'
s {$sel:authorizationType:GetRouteResponse'' :: Maybe AuthorizationType
authorizationType = Maybe AuthorizationType
a} :: GetRouteResponse')

-- | 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.
getRouteResponse'_authorizerId :: Lens.Lens' GetRouteResponse' (Prelude.Maybe Prelude.Text)
getRouteResponse'_authorizerId :: Lens' GetRouteResponse' (Maybe Text)
getRouteResponse'_authorizerId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRouteResponse'' {Maybe Text
authorizerId :: Maybe Text
$sel:authorizerId:GetRouteResponse'' :: GetRouteResponse' -> Maybe Text
authorizerId} -> Maybe Text
authorizerId) (\s :: GetRouteResponse'
s@GetRouteResponse'' {} Maybe Text
a -> GetRouteResponse'
s {$sel:authorizerId:GetRouteResponse'' :: Maybe Text
authorizerId = Maybe Text
a} :: GetRouteResponse')

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

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

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

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

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

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

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

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

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

instance Prelude.NFData GetRouteResponse' where
  rnf :: GetRouteResponse' -> ()
rnf GetRouteResponse'' {Int
Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text ParameterConstraints)
Maybe AuthorizationType
httpStatus :: Int
target :: Maybe Text
routeResponseSelectionExpression :: Maybe Text
routeKey :: Maybe Text
routeId :: Maybe Text
requestParameters :: Maybe (HashMap Text ParameterConstraints)
requestModels :: Maybe (HashMap Text Text)
operationName :: Maybe Text
modelSelectionExpression :: Maybe Text
authorizerId :: Maybe Text
authorizationType :: Maybe AuthorizationType
authorizationScopes :: Maybe [Text]
apiKeyRequired :: Maybe Bool
apiGatewayManaged :: Maybe Bool
$sel:httpStatus:GetRouteResponse'' :: GetRouteResponse' -> Int
$sel:target:GetRouteResponse'' :: GetRouteResponse' -> Maybe Text
$sel:routeResponseSelectionExpression:GetRouteResponse'' :: GetRouteResponse' -> Maybe Text
$sel:routeKey:GetRouteResponse'' :: GetRouteResponse' -> Maybe Text
$sel:routeId:GetRouteResponse'' :: GetRouteResponse' -> Maybe Text
$sel:requestParameters:GetRouteResponse'' :: GetRouteResponse' -> Maybe (HashMap Text ParameterConstraints)
$sel:requestModels:GetRouteResponse'' :: GetRouteResponse' -> Maybe (HashMap Text Text)
$sel:operationName:GetRouteResponse'' :: GetRouteResponse' -> Maybe Text
$sel:modelSelectionExpression:GetRouteResponse'' :: GetRouteResponse' -> Maybe Text
$sel:authorizerId:GetRouteResponse'' :: GetRouteResponse' -> Maybe Text
$sel:authorizationType:GetRouteResponse'' :: GetRouteResponse' -> Maybe AuthorizationType
$sel:authorizationScopes:GetRouteResponse'' :: GetRouteResponse' -> Maybe [Text]
$sel:apiKeyRequired:GetRouteResponse'' :: GetRouteResponse' -> Maybe Bool
$sel:apiGatewayManaged:GetRouteResponse'' :: GetRouteResponse' -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
apiGatewayManaged
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
apiKeyRequired
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
authorizationScopes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AuthorizationType
authorizationType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authorizerId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
modelSelectionExpression
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
operationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
requestModels
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text ParameterConstraints)
requestParameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
routeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
routeKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
routeResponseSelectionExpression
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
target
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus