{-# 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 #-}
module Amazonka.APIGateway.Types.Method where
import Amazonka.APIGateway.Types.Integration
import Amazonka.APIGateway.Types.MethodResponse
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
data Method = Method'
{
Method -> Maybe Bool
apiKeyRequired :: Prelude.Maybe Prelude.Bool,
Method -> Maybe [Text]
authorizationScopes :: Prelude.Maybe [Prelude.Text],
Method -> Maybe Text
authorizationType :: Prelude.Maybe Prelude.Text,
Method -> Maybe Text
authorizerId :: Prelude.Maybe Prelude.Text,
Method -> Maybe Text
httpMethod :: Prelude.Maybe Prelude.Text,
Method -> Maybe Integration
methodIntegration :: Prelude.Maybe Integration,
Method -> Maybe (HashMap Text MethodResponse)
methodResponses :: Prelude.Maybe (Prelude.HashMap Prelude.Text MethodResponse),
Method -> Maybe Text
operationName :: Prelude.Maybe Prelude.Text,
Method -> Maybe (HashMap Text Text)
requestModels :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
Method -> Maybe (HashMap Text Bool)
requestParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Bool),
Method -> Maybe Text
requestValidatorId :: Prelude.Maybe Prelude.Text
}
deriving (Method -> Method -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Method -> Method -> Bool
$c/= :: Method -> Method -> Bool
== :: Method -> Method -> Bool
$c== :: Method -> Method -> Bool
Prelude.Eq, ReadPrec [Method]
ReadPrec Method
Int -> ReadS Method
ReadS [Method]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Method]
$creadListPrec :: ReadPrec [Method]
readPrec :: ReadPrec Method
$creadPrec :: ReadPrec Method
readList :: ReadS [Method]
$creadList :: ReadS [Method]
readsPrec :: Int -> ReadS Method
$creadsPrec :: Int -> ReadS Method
Prelude.Read, Int -> Method -> ShowS
[Method] -> ShowS
Method -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Method] -> ShowS
$cshowList :: [Method] -> ShowS
show :: Method -> String
$cshow :: Method -> String
showsPrec :: Int -> Method -> ShowS
$cshowsPrec :: Int -> Method -> ShowS
Prelude.Show, forall x. Rep Method x -> Method
forall x. Method -> Rep Method x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Method x -> Method
$cfrom :: forall x. Method -> Rep Method x
Prelude.Generic)
newMethod ::
Method
newMethod :: Method
newMethod =
Method'
{ $sel:apiKeyRequired:Method' :: Maybe Bool
apiKeyRequired = forall a. Maybe a
Prelude.Nothing,
$sel:authorizationScopes:Method' :: Maybe [Text]
authorizationScopes = forall a. Maybe a
Prelude.Nothing,
$sel:authorizationType:Method' :: Maybe Text
authorizationType = forall a. Maybe a
Prelude.Nothing,
$sel:authorizerId:Method' :: Maybe Text
authorizerId = forall a. Maybe a
Prelude.Nothing,
$sel:httpMethod:Method' :: Maybe Text
httpMethod = forall a. Maybe a
Prelude.Nothing,
$sel:methodIntegration:Method' :: Maybe Integration
methodIntegration = forall a. Maybe a
Prelude.Nothing,
$sel:methodResponses:Method' :: Maybe (HashMap Text MethodResponse)
methodResponses = forall a. Maybe a
Prelude.Nothing,
$sel:operationName:Method' :: Maybe Text
operationName = forall a. Maybe a
Prelude.Nothing,
$sel:requestModels:Method' :: Maybe (HashMap Text Text)
requestModels = forall a. Maybe a
Prelude.Nothing,
$sel:requestParameters:Method' :: Maybe (HashMap Text Bool)
requestParameters = forall a. Maybe a
Prelude.Nothing,
$sel:requestValidatorId:Method' :: Maybe Text
requestValidatorId = forall a. Maybe a
Prelude.Nothing
}
method_apiKeyRequired :: Lens.Lens' Method (Prelude.Maybe Prelude.Bool)
method_apiKeyRequired :: Lens' Method (Maybe Bool)
method_apiKeyRequired = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Method' {Maybe Bool
apiKeyRequired :: Maybe Bool
$sel:apiKeyRequired:Method' :: Method -> Maybe Bool
apiKeyRequired} -> Maybe Bool
apiKeyRequired) (\s :: Method
s@Method' {} Maybe Bool
a -> Method
s {$sel:apiKeyRequired:Method' :: Maybe Bool
apiKeyRequired = Maybe Bool
a} :: Method)
method_authorizationScopes :: Lens.Lens' Method (Prelude.Maybe [Prelude.Text])
method_authorizationScopes :: Lens' Method (Maybe [Text])
method_authorizationScopes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Method' {Maybe [Text]
authorizationScopes :: Maybe [Text]
$sel:authorizationScopes:Method' :: Method -> Maybe [Text]
authorizationScopes} -> Maybe [Text]
authorizationScopes) (\s :: Method
s@Method' {} Maybe [Text]
a -> Method
s {$sel:authorizationScopes:Method' :: Maybe [Text]
authorizationScopes = Maybe [Text]
a} :: Method) 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
method_authorizationType :: Lens.Lens' Method (Prelude.Maybe Prelude.Text)
method_authorizationType :: Lens' Method (Maybe Text)
method_authorizationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Method' {Maybe Text
authorizationType :: Maybe Text
$sel:authorizationType:Method' :: Method -> Maybe Text
authorizationType} -> Maybe Text
authorizationType) (\s :: Method
s@Method' {} Maybe Text
a -> Method
s {$sel:authorizationType:Method' :: Maybe Text
authorizationType = Maybe Text
a} :: Method)
method_authorizerId :: Lens.Lens' Method (Prelude.Maybe Prelude.Text)
method_authorizerId :: Lens' Method (Maybe Text)
method_authorizerId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Method' {Maybe Text
authorizerId :: Maybe Text
$sel:authorizerId:Method' :: Method -> Maybe Text
authorizerId} -> Maybe Text
authorizerId) (\s :: Method
s@Method' {} Maybe Text
a -> Method
s {$sel:authorizerId:Method' :: Maybe Text
authorizerId = Maybe Text
a} :: Method)
method_httpMethod :: Lens.Lens' Method (Prelude.Maybe Prelude.Text)
method_httpMethod :: Lens' Method (Maybe Text)
method_httpMethod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Method' {Maybe Text
httpMethod :: Maybe Text
$sel:httpMethod:Method' :: Method -> Maybe Text
httpMethod} -> Maybe Text
httpMethod) (\s :: Method
s@Method' {} Maybe Text
a -> Method
s {$sel:httpMethod:Method' :: Maybe Text
httpMethod = Maybe Text
a} :: Method)
method_methodIntegration :: Lens.Lens' Method (Prelude.Maybe Integration)
method_methodIntegration :: Lens' Method (Maybe Integration)
method_methodIntegration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Method' {Maybe Integration
methodIntegration :: Maybe Integration
$sel:methodIntegration:Method' :: Method -> Maybe Integration
methodIntegration} -> Maybe Integration
methodIntegration) (\s :: Method
s@Method' {} Maybe Integration
a -> Method
s {$sel:methodIntegration:Method' :: Maybe Integration
methodIntegration = Maybe Integration
a} :: Method)
method_methodResponses :: Lens.Lens' Method (Prelude.Maybe (Prelude.HashMap Prelude.Text MethodResponse))
method_methodResponses :: Lens' Method (Maybe (HashMap Text MethodResponse))
method_methodResponses = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Method' {Maybe (HashMap Text MethodResponse)
methodResponses :: Maybe (HashMap Text MethodResponse)
$sel:methodResponses:Method' :: Method -> Maybe (HashMap Text MethodResponse)
methodResponses} -> Maybe (HashMap Text MethodResponse)
methodResponses) (\s :: Method
s@Method' {} Maybe (HashMap Text MethodResponse)
a -> Method
s {$sel:methodResponses:Method' :: Maybe (HashMap Text MethodResponse)
methodResponses = Maybe (HashMap Text MethodResponse)
a} :: Method) 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
method_operationName :: Lens.Lens' Method (Prelude.Maybe Prelude.Text)
method_operationName :: Lens' Method (Maybe Text)
method_operationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Method' {Maybe Text
operationName :: Maybe Text
$sel:operationName:Method' :: Method -> Maybe Text
operationName} -> Maybe Text
operationName) (\s :: Method
s@Method' {} Maybe Text
a -> Method
s {$sel:operationName:Method' :: Maybe Text
operationName = Maybe Text
a} :: Method)
method_requestModels :: Lens.Lens' Method (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
method_requestModels :: Lens' Method (Maybe (HashMap Text Text))
method_requestModels = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Method' {Maybe (HashMap Text Text)
requestModels :: Maybe (HashMap Text Text)
$sel:requestModels:Method' :: Method -> Maybe (HashMap Text Text)
requestModels} -> Maybe (HashMap Text Text)
requestModels) (\s :: Method
s@Method' {} Maybe (HashMap Text Text)
a -> Method
s {$sel:requestModels:Method' :: Maybe (HashMap Text Text)
requestModels = Maybe (HashMap Text Text)
a} :: Method) 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
method_requestParameters :: Lens.Lens' Method (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Bool))
method_requestParameters :: Lens' Method (Maybe (HashMap Text Bool))
method_requestParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Method' {Maybe (HashMap Text Bool)
requestParameters :: Maybe (HashMap Text Bool)
$sel:requestParameters:Method' :: Method -> Maybe (HashMap Text Bool)
requestParameters} -> Maybe (HashMap Text Bool)
requestParameters) (\s :: Method
s@Method' {} Maybe (HashMap Text Bool)
a -> Method
s {$sel:requestParameters:Method' :: Maybe (HashMap Text Bool)
requestParameters = Maybe (HashMap Text Bool)
a} :: Method) 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
method_requestValidatorId :: Lens.Lens' Method (Prelude.Maybe Prelude.Text)
method_requestValidatorId :: Lens' Method (Maybe Text)
method_requestValidatorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Method' {Maybe Text
requestValidatorId :: Maybe Text
$sel:requestValidatorId:Method' :: Method -> Maybe Text
requestValidatorId} -> Maybe Text
requestValidatorId) (\s :: Method
s@Method' {} Maybe Text
a -> Method
s {$sel:requestValidatorId:Method' :: Maybe Text
requestValidatorId = Maybe Text
a} :: Method)
instance Data.FromJSON Method where
parseJSON :: Value -> Parser Method
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Method"
( \Object
x ->
Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integration
-> Maybe (HashMap Text MethodResponse)
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Bool)
-> Maybe Text
-> Method
Method'
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
"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
"httpMethod")
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
"methodIntegration")
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
"methodResponses"
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
"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
"requestValidatorId")
)
instance Prelude.Hashable Method where
hashWithSalt :: Int -> Method -> Int
hashWithSalt Int
_salt Method' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Bool)
Maybe (HashMap Text Text)
Maybe (HashMap Text MethodResponse)
Maybe Integration
requestValidatorId :: Maybe Text
requestParameters :: Maybe (HashMap Text Bool)
requestModels :: Maybe (HashMap Text Text)
operationName :: Maybe Text
methodResponses :: Maybe (HashMap Text MethodResponse)
methodIntegration :: Maybe Integration
httpMethod :: Maybe Text
authorizerId :: Maybe Text
authorizationType :: Maybe Text
authorizationScopes :: Maybe [Text]
apiKeyRequired :: Maybe Bool
$sel:requestValidatorId:Method' :: Method -> Maybe Text
$sel:requestParameters:Method' :: Method -> Maybe (HashMap Text Bool)
$sel:requestModels:Method' :: Method -> Maybe (HashMap Text Text)
$sel:operationName:Method' :: Method -> Maybe Text
$sel:methodResponses:Method' :: Method -> Maybe (HashMap Text MethodResponse)
$sel:methodIntegration:Method' :: Method -> Maybe Integration
$sel:httpMethod:Method' :: Method -> Maybe Text
$sel:authorizerId:Method' :: Method -> Maybe Text
$sel:authorizationType:Method' :: Method -> Maybe Text
$sel:authorizationScopes:Method' :: Method -> Maybe [Text]
$sel:apiKeyRequired:Method' :: Method -> Maybe Bool
..} =
Int
_salt
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 Text
authorizationType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authorizerId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
httpMethod
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integration
methodIntegration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text MethodResponse)
methodResponses
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 Bool)
requestParameters
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
requestValidatorId
instance Prelude.NFData Method where
rnf :: Method -> ()
rnf Method' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Bool)
Maybe (HashMap Text Text)
Maybe (HashMap Text MethodResponse)
Maybe Integration
requestValidatorId :: Maybe Text
requestParameters :: Maybe (HashMap Text Bool)
requestModels :: Maybe (HashMap Text Text)
operationName :: Maybe Text
methodResponses :: Maybe (HashMap Text MethodResponse)
methodIntegration :: Maybe Integration
httpMethod :: Maybe Text
authorizerId :: Maybe Text
authorizationType :: Maybe Text
authorizationScopes :: Maybe [Text]
apiKeyRequired :: Maybe Bool
$sel:requestValidatorId:Method' :: Method -> Maybe Text
$sel:requestParameters:Method' :: Method -> Maybe (HashMap Text Bool)
$sel:requestModels:Method' :: Method -> Maybe (HashMap Text Text)
$sel:operationName:Method' :: Method -> Maybe Text
$sel:methodResponses:Method' :: Method -> Maybe (HashMap Text MethodResponse)
$sel:methodIntegration:Method' :: Method -> Maybe Integration
$sel:httpMethod:Method' :: Method -> Maybe Text
$sel:authorizerId:Method' :: Method -> Maybe Text
$sel:authorizationType:Method' :: Method -> Maybe Text
$sel:authorizationScopes:Method' :: Method -> Maybe [Text]
$sel:apiKeyRequired:Method' :: Method -> Maybe Bool
..} =
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 Text
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
httpMethod
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integration
methodIntegration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text MethodResponse)
methodResponses
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 Bool)
requestParameters
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requestValidatorId