{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.Route
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ApiGatewayV2.Types.Route where

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

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

-- |
-- Create a value of 'Route' 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', 'route_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', 'route_apiKeyRequired' - Specifies whether an API key is required for this route. Supported only
-- for WebSocket APIs.
--
-- 'authorizationScopes', 'route_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', 'route_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', 'route_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', 'route_modelSelectionExpression' - The model selection expression for the route. Supported only for
-- WebSocket APIs.
--
-- 'operationName', 'route_operationName' - The operation name for the route.
--
-- 'requestModels', 'route_requestModels' - The request models for the route. Supported only for WebSocket APIs.
--
-- 'requestParameters', 'route_requestParameters' - The request parameters for the route. Supported only for WebSocket APIs.
--
-- 'routeId', 'route_routeId' - The route ID.
--
-- 'routeResponseSelectionExpression', 'route_routeResponseSelectionExpression' - The route response selection expression for the route. Supported only
-- for WebSocket APIs.
--
-- 'target', 'route_target' - The target for the route.
--
-- 'routeKey', 'route_routeKey' - The route key for the route.
newRoute ::
  -- | 'routeKey'
  Prelude.Text ->
  Route
newRoute :: Text -> Route
newRoute Text
pRouteKey_ =
  Route'
    { $sel:apiGatewayManaged:Route' :: Maybe Bool
apiGatewayManaged = forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeyRequired:Route' :: Maybe Bool
apiKeyRequired = forall a. Maybe a
Prelude.Nothing,
      $sel:authorizationScopes:Route' :: Maybe [Text]
authorizationScopes = forall a. Maybe a
Prelude.Nothing,
      $sel:authorizationType:Route' :: Maybe AuthorizationType
authorizationType = forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerId:Route' :: Maybe Text
authorizerId = forall a. Maybe a
Prelude.Nothing,
      $sel:modelSelectionExpression:Route' :: Maybe Text
modelSelectionExpression = forall a. Maybe a
Prelude.Nothing,
      $sel:operationName:Route' :: Maybe Text
operationName = forall a. Maybe a
Prelude.Nothing,
      $sel:requestModels:Route' :: Maybe (HashMap Text Text)
requestModels = forall a. Maybe a
Prelude.Nothing,
      $sel:requestParameters:Route' :: Maybe (HashMap Text ParameterConstraints)
requestParameters = forall a. Maybe a
Prelude.Nothing,
      $sel:routeId:Route' :: Maybe Text
routeId = forall a. Maybe a
Prelude.Nothing,
      $sel:routeResponseSelectionExpression:Route' :: Maybe Text
routeResponseSelectionExpression = forall a. Maybe a
Prelude.Nothing,
      $sel:target:Route' :: Maybe Text
target = forall a. Maybe a
Prelude.Nothing,
      $sel:routeKey:Route' :: Text
routeKey = Text
pRouteKey_
    }

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

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

-- | 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.
route_authorizationScopes :: Lens.Lens' Route (Prelude.Maybe [Prelude.Text])
route_authorizationScopes :: Lens' Route (Maybe [Text])
route_authorizationScopes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Route' {Maybe [Text]
authorizationScopes :: Maybe [Text]
$sel:authorizationScopes:Route' :: Route -> Maybe [Text]
authorizationScopes} -> Maybe [Text]
authorizationScopes) (\s :: Route
s@Route' {} Maybe [Text]
a -> Route
s {$sel:authorizationScopes:Route' :: Maybe [Text]
authorizationScopes = Maybe [Text]
a} :: Route) 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.
route_authorizationType :: Lens.Lens' Route (Prelude.Maybe AuthorizationType)
route_authorizationType :: Lens' Route (Maybe AuthorizationType)
route_authorizationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Route' {Maybe AuthorizationType
authorizationType :: Maybe AuthorizationType
$sel:authorizationType:Route' :: Route -> Maybe AuthorizationType
authorizationType} -> Maybe AuthorizationType
authorizationType) (\s :: Route
s@Route' {} Maybe AuthorizationType
a -> Route
s {$sel:authorizationType:Route' :: Maybe AuthorizationType
authorizationType = Maybe AuthorizationType
a} :: Route)

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

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

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

-- | The request models for the route. Supported only for WebSocket APIs.
route_requestModels :: Lens.Lens' Route (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
route_requestModels :: Lens' Route (Maybe (HashMap Text Text))
route_requestModels = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Route' {Maybe (HashMap Text Text)
requestModels :: Maybe (HashMap Text Text)
$sel:requestModels:Route' :: Route -> Maybe (HashMap Text Text)
requestModels} -> Maybe (HashMap Text Text)
requestModels) (\s :: Route
s@Route' {} Maybe (HashMap Text Text)
a -> Route
s {$sel:requestModels:Route' :: Maybe (HashMap Text Text)
requestModels = Maybe (HashMap Text Text)
a} :: Route) 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.
route_requestParameters :: Lens.Lens' Route (Prelude.Maybe (Prelude.HashMap Prelude.Text ParameterConstraints))
route_requestParameters :: Lens' Route (Maybe (HashMap Text ParameterConstraints))
route_requestParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Route' {Maybe (HashMap Text ParameterConstraints)
requestParameters :: Maybe (HashMap Text ParameterConstraints)
$sel:requestParameters:Route' :: Route -> Maybe (HashMap Text ParameterConstraints)
requestParameters} -> Maybe (HashMap Text ParameterConstraints)
requestParameters) (\s :: Route
s@Route' {} Maybe (HashMap Text ParameterConstraints)
a -> Route
s {$sel:requestParameters:Route' :: Maybe (HashMap Text ParameterConstraints)
requestParameters = Maybe (HashMap Text ParameterConstraints)
a} :: Route) 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.
route_routeId :: Lens.Lens' Route (Prelude.Maybe Prelude.Text)
route_routeId :: Lens' Route (Maybe Text)
route_routeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Route' {Maybe Text
routeId :: Maybe Text
$sel:routeId:Route' :: Route -> Maybe Text
routeId} -> Maybe Text
routeId) (\s :: Route
s@Route' {} Maybe Text
a -> Route
s {$sel:routeId:Route' :: Maybe Text
routeId = Maybe Text
a} :: Route)

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

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

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

instance Data.FromJSON Route where
  parseJSON :: Value -> Parser Route
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Route"
      ( \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
-> Text
-> Route
Route'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (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 -> Parser (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 -> Parser (Maybe a)
Data..:? Key
"authorizationScopes"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser (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 -> Parser (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 -> Parser (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 -> Parser (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 -> Parser (Maybe a)
Data..:? Key
"requestModels" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser (Maybe a)
Data..:? Key
"requestParameters"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser (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 -> Parser (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 -> Parser (Maybe a)
Data..:? Key
"target")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"routeKey")
      )

instance Prelude.Hashable Route where
  hashWithSalt :: Int -> Route -> Int
hashWithSalt Int
_salt Route' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text ParameterConstraints)
Maybe AuthorizationType
Text
routeKey :: Text
target :: Maybe Text
routeResponseSelectionExpression :: 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:routeKey:Route' :: Route -> Text
$sel:target:Route' :: Route -> Maybe Text
$sel:routeResponseSelectionExpression:Route' :: Route -> Maybe Text
$sel:routeId:Route' :: Route -> Maybe Text
$sel:requestParameters:Route' :: Route -> Maybe (HashMap Text ParameterConstraints)
$sel:requestModels:Route' :: Route -> Maybe (HashMap Text Text)
$sel:operationName:Route' :: Route -> Maybe Text
$sel:modelSelectionExpression:Route' :: Route -> Maybe Text
$sel:authorizerId:Route' :: Route -> Maybe Text
$sel:authorizationType:Route' :: Route -> Maybe AuthorizationType
$sel:authorizationScopes:Route' :: Route -> Maybe [Text]
$sel:apiKeyRequired:Route' :: Route -> Maybe Bool
$sel:apiGatewayManaged:Route' :: Route -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
apiGatewayManaged
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
apiKeyRequired
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
authorizationScopes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AuthorizationType
authorizationType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authorizerId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
modelSelectionExpression
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
operationName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
requestModels
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text ParameterConstraints)
requestParameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
routeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
routeResponseSelectionExpression
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
target
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
routeKey

instance Prelude.NFData Route where
  rnf :: Route -> ()
rnf Route' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text ParameterConstraints)
Maybe AuthorizationType
Text
routeKey :: Text
target :: Maybe Text
routeResponseSelectionExpression :: 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:routeKey:Route' :: Route -> Text
$sel:target:Route' :: Route -> Maybe Text
$sel:routeResponseSelectionExpression:Route' :: Route -> Maybe Text
$sel:routeId:Route' :: Route -> Maybe Text
$sel:requestParameters:Route' :: Route -> Maybe (HashMap Text ParameterConstraints)
$sel:requestModels:Route' :: Route -> Maybe (HashMap Text Text)
$sel:operationName:Route' :: Route -> Maybe Text
$sel:modelSelectionExpression:Route' :: Route -> Maybe Text
$sel:authorizerId:Route' :: Route -> Maybe Text
$sel:authorizationType:Route' :: Route -> Maybe AuthorizationType
$sel:authorizationScopes:Route' :: Route -> Maybe [Text]
$sel:apiKeyRequired:Route' :: Route -> Maybe Bool
$sel:apiGatewayManaged:Route' :: Route -> 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
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 Text
routeKey