{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.APIGateway.PutMethod
(
PutMethod (..),
newPutMethod,
putMethod_authorizationScopes,
putMethod_requestValidatorId,
putMethod_requestModels,
putMethod_requestParameters,
putMethod_authorizerId,
putMethod_operationName,
putMethod_apiKeyRequired,
putMethod_restApiId,
putMethod_resourceId,
putMethod_httpMethod,
putMethod_authorizationType,
Method (..),
newMethod,
method_methodResponses,
method_httpMethod,
method_authorizationScopes,
method_requestValidatorId,
method_requestModels,
method_requestParameters,
method_authorizerId,
method_operationName,
method_authorizationType,
method_apiKeyRequired,
method_methodIntegration,
)
where
import Amazonka.APIGateway.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutMethod = PutMethod'
{
PutMethod -> Maybe [Text]
authorizationScopes :: Prelude.Maybe [Prelude.Text],
PutMethod -> Maybe Text
requestValidatorId :: Prelude.Maybe Prelude.Text,
PutMethod -> Maybe (HashMap Text Text)
requestModels :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
PutMethod -> Maybe (HashMap Text Bool)
requestParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Bool),
PutMethod -> Maybe Text
authorizerId :: Prelude.Maybe Prelude.Text,
PutMethod -> Maybe Text
operationName :: Prelude.Maybe Prelude.Text,
PutMethod -> Maybe Bool
apiKeyRequired :: Prelude.Maybe Prelude.Bool,
PutMethod -> Text
restApiId :: Prelude.Text,
PutMethod -> Text
resourceId :: Prelude.Text,
PutMethod -> Text
httpMethod :: Prelude.Text,
PutMethod -> Text
authorizationType :: Prelude.Text
}
deriving (PutMethod -> PutMethod -> Bool
(PutMethod -> PutMethod -> Bool)
-> (PutMethod -> PutMethod -> Bool) -> Eq PutMethod
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutMethod -> PutMethod -> Bool
$c/= :: PutMethod -> PutMethod -> Bool
== :: PutMethod -> PutMethod -> Bool
$c== :: PutMethod -> PutMethod -> Bool
Prelude.Eq, ReadPrec [PutMethod]
ReadPrec PutMethod
Int -> ReadS PutMethod
ReadS [PutMethod]
(Int -> ReadS PutMethod)
-> ReadS [PutMethod]
-> ReadPrec PutMethod
-> ReadPrec [PutMethod]
-> Read PutMethod
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutMethod]
$creadListPrec :: ReadPrec [PutMethod]
readPrec :: ReadPrec PutMethod
$creadPrec :: ReadPrec PutMethod
readList :: ReadS [PutMethod]
$creadList :: ReadS [PutMethod]
readsPrec :: Int -> ReadS PutMethod
$creadsPrec :: Int -> ReadS PutMethod
Prelude.Read, Int -> PutMethod -> ShowS
[PutMethod] -> ShowS
PutMethod -> String
(Int -> PutMethod -> ShowS)
-> (PutMethod -> String)
-> ([PutMethod] -> ShowS)
-> Show PutMethod
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutMethod] -> ShowS
$cshowList :: [PutMethod] -> ShowS
show :: PutMethod -> String
$cshow :: PutMethod -> String
showsPrec :: Int -> PutMethod -> ShowS
$cshowsPrec :: Int -> PutMethod -> ShowS
Prelude.Show, (forall x. PutMethod -> Rep PutMethod x)
-> (forall x. Rep PutMethod x -> PutMethod) -> Generic PutMethod
forall x. Rep PutMethod x -> PutMethod
forall x. PutMethod -> Rep PutMethod x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutMethod x -> PutMethod
$cfrom :: forall x. PutMethod -> Rep PutMethod x
Prelude.Generic)
newPutMethod ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
PutMethod
newPutMethod :: Text -> Text -> Text -> Text -> PutMethod
newPutMethod
Text
pRestApiId_
Text
pResourceId_
Text
pHttpMethod_
Text
pAuthorizationType_ =
PutMethod' :: Maybe [Text]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Bool)
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Text
-> Text
-> Text
-> Text
-> PutMethod
PutMethod'
{ $sel:authorizationScopes:PutMethod' :: Maybe [Text]
authorizationScopes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:requestValidatorId:PutMethod' :: Maybe Text
requestValidatorId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:requestModels:PutMethod' :: Maybe (HashMap Text Text)
requestModels = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:requestParameters:PutMethod' :: Maybe (HashMap Text Bool)
requestParameters = Maybe (HashMap Text Bool)
forall a. Maybe a
Prelude.Nothing,
$sel:authorizerId:PutMethod' :: Maybe Text
authorizerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:operationName:PutMethod' :: Maybe Text
operationName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:apiKeyRequired:PutMethod' :: Maybe Bool
apiKeyRequired = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:restApiId:PutMethod' :: Text
restApiId = Text
pRestApiId_,
$sel:resourceId:PutMethod' :: Text
resourceId = Text
pResourceId_,
$sel:httpMethod:PutMethod' :: Text
httpMethod = Text
pHttpMethod_,
$sel:authorizationType:PutMethod' :: Text
authorizationType = Text
pAuthorizationType_
}
putMethod_authorizationScopes :: Lens.Lens' PutMethod (Prelude.Maybe [Prelude.Text])
putMethod_authorizationScopes :: (Maybe [Text] -> f (Maybe [Text])) -> PutMethod -> f PutMethod
putMethod_authorizationScopes = (PutMethod -> Maybe [Text])
-> (PutMethod -> Maybe [Text] -> PutMethod)
-> Lens PutMethod PutMethod (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMethod' {Maybe [Text]
authorizationScopes :: Maybe [Text]
$sel:authorizationScopes:PutMethod' :: PutMethod -> Maybe [Text]
authorizationScopes} -> Maybe [Text]
authorizationScopes) (\s :: PutMethod
s@PutMethod' {} Maybe [Text]
a -> PutMethod
s {$sel:authorizationScopes:PutMethod' :: Maybe [Text]
authorizationScopes = Maybe [Text]
a} :: PutMethod) ((Maybe [Text] -> f (Maybe [Text])) -> PutMethod -> f PutMethod)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PutMethod
-> f PutMethod
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
putMethod_requestValidatorId :: Lens.Lens' PutMethod (Prelude.Maybe Prelude.Text)
putMethod_requestValidatorId :: (Maybe Text -> f (Maybe Text)) -> PutMethod -> f PutMethod
putMethod_requestValidatorId = (PutMethod -> Maybe Text)
-> (PutMethod -> Maybe Text -> PutMethod)
-> Lens PutMethod PutMethod (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMethod' {Maybe Text
requestValidatorId :: Maybe Text
$sel:requestValidatorId:PutMethod' :: PutMethod -> Maybe Text
requestValidatorId} -> Maybe Text
requestValidatorId) (\s :: PutMethod
s@PutMethod' {} Maybe Text
a -> PutMethod
s {$sel:requestValidatorId:PutMethod' :: Maybe Text
requestValidatorId = Maybe Text
a} :: PutMethod)
putMethod_requestModels :: Lens.Lens' PutMethod (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
putMethod_requestModels :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PutMethod -> f PutMethod
putMethod_requestModels = (PutMethod -> Maybe (HashMap Text Text))
-> (PutMethod -> Maybe (HashMap Text Text) -> PutMethod)
-> Lens
PutMethod
PutMethod
(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 (\PutMethod' {Maybe (HashMap Text Text)
requestModels :: Maybe (HashMap Text Text)
$sel:requestModels:PutMethod' :: PutMethod -> Maybe (HashMap Text Text)
requestModels} -> Maybe (HashMap Text Text)
requestModels) (\s :: PutMethod
s@PutMethod' {} Maybe (HashMap Text Text)
a -> PutMethod
s {$sel:requestModels:PutMethod' :: Maybe (HashMap Text Text)
requestModels = Maybe (HashMap Text Text)
a} :: PutMethod) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PutMethod -> f PutMethod)
-> ((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)))
-> PutMethod
-> f PutMethod
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
putMethod_requestParameters :: Lens.Lens' PutMethod (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Bool))
putMethod_requestParameters :: (Maybe (HashMap Text Bool) -> f (Maybe (HashMap Text Bool)))
-> PutMethod -> f PutMethod
putMethod_requestParameters = (PutMethod -> Maybe (HashMap Text Bool))
-> (PutMethod -> Maybe (HashMap Text Bool) -> PutMethod)
-> Lens
PutMethod
PutMethod
(Maybe (HashMap Text Bool))
(Maybe (HashMap Text Bool))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMethod' {Maybe (HashMap Text Bool)
requestParameters :: Maybe (HashMap Text Bool)
$sel:requestParameters:PutMethod' :: PutMethod -> Maybe (HashMap Text Bool)
requestParameters} -> Maybe (HashMap Text Bool)
requestParameters) (\s :: PutMethod
s@PutMethod' {} Maybe (HashMap Text Bool)
a -> PutMethod
s {$sel:requestParameters:PutMethod' :: Maybe (HashMap Text Bool)
requestParameters = Maybe (HashMap Text Bool)
a} :: PutMethod) ((Maybe (HashMap Text Bool) -> f (Maybe (HashMap Text Bool)))
-> PutMethod -> f PutMethod)
-> ((Maybe (HashMap Text Bool) -> f (Maybe (HashMap Text Bool)))
-> Maybe (HashMap Text Bool) -> f (Maybe (HashMap Text Bool)))
-> (Maybe (HashMap Text Bool) -> f (Maybe (HashMap Text Bool)))
-> PutMethod
-> f PutMethod
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Bool)
(HashMap Text Bool)
(HashMap Text Bool)
(HashMap Text Bool)
-> Iso
(Maybe (HashMap Text Bool))
(Maybe (HashMap Text Bool))
(Maybe (HashMap Text Bool))
(Maybe (HashMap Text Bool))
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 Bool)
(HashMap Text Bool)
(HashMap Text Bool)
(HashMap Text Bool)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putMethod_authorizerId :: Lens.Lens' PutMethod (Prelude.Maybe Prelude.Text)
putMethod_authorizerId :: (Maybe Text -> f (Maybe Text)) -> PutMethod -> f PutMethod
putMethod_authorizerId = (PutMethod -> Maybe Text)
-> (PutMethod -> Maybe Text -> PutMethod)
-> Lens PutMethod PutMethod (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMethod' {Maybe Text
authorizerId :: Maybe Text
$sel:authorizerId:PutMethod' :: PutMethod -> Maybe Text
authorizerId} -> Maybe Text
authorizerId) (\s :: PutMethod
s@PutMethod' {} Maybe Text
a -> PutMethod
s {$sel:authorizerId:PutMethod' :: Maybe Text
authorizerId = Maybe Text
a} :: PutMethod)
putMethod_operationName :: Lens.Lens' PutMethod (Prelude.Maybe Prelude.Text)
putMethod_operationName :: (Maybe Text -> f (Maybe Text)) -> PutMethod -> f PutMethod
putMethod_operationName = (PutMethod -> Maybe Text)
-> (PutMethod -> Maybe Text -> PutMethod)
-> Lens PutMethod PutMethod (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMethod' {Maybe Text
operationName :: Maybe Text
$sel:operationName:PutMethod' :: PutMethod -> Maybe Text
operationName} -> Maybe Text
operationName) (\s :: PutMethod
s@PutMethod' {} Maybe Text
a -> PutMethod
s {$sel:operationName:PutMethod' :: Maybe Text
operationName = Maybe Text
a} :: PutMethod)
putMethod_apiKeyRequired :: Lens.Lens' PutMethod (Prelude.Maybe Prelude.Bool)
putMethod_apiKeyRequired :: (Maybe Bool -> f (Maybe Bool)) -> PutMethod -> f PutMethod
putMethod_apiKeyRequired = (PutMethod -> Maybe Bool)
-> (PutMethod -> Maybe Bool -> PutMethod)
-> Lens PutMethod PutMethod (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMethod' {Maybe Bool
apiKeyRequired :: Maybe Bool
$sel:apiKeyRequired:PutMethod' :: PutMethod -> Maybe Bool
apiKeyRequired} -> Maybe Bool
apiKeyRequired) (\s :: PutMethod
s@PutMethod' {} Maybe Bool
a -> PutMethod
s {$sel:apiKeyRequired:PutMethod' :: Maybe Bool
apiKeyRequired = Maybe Bool
a} :: PutMethod)
putMethod_restApiId :: Lens.Lens' PutMethod Prelude.Text
putMethod_restApiId :: (Text -> f Text) -> PutMethod -> f PutMethod
putMethod_restApiId = (PutMethod -> Text)
-> (PutMethod -> Text -> PutMethod)
-> Lens PutMethod PutMethod Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMethod' {Text
restApiId :: Text
$sel:restApiId:PutMethod' :: PutMethod -> Text
restApiId} -> Text
restApiId) (\s :: PutMethod
s@PutMethod' {} Text
a -> PutMethod
s {$sel:restApiId:PutMethod' :: Text
restApiId = Text
a} :: PutMethod)
putMethod_resourceId :: Lens.Lens' PutMethod Prelude.Text
putMethod_resourceId :: (Text -> f Text) -> PutMethod -> f PutMethod
putMethod_resourceId = (PutMethod -> Text)
-> (PutMethod -> Text -> PutMethod)
-> Lens PutMethod PutMethod Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMethod' {Text
resourceId :: Text
$sel:resourceId:PutMethod' :: PutMethod -> Text
resourceId} -> Text
resourceId) (\s :: PutMethod
s@PutMethod' {} Text
a -> PutMethod
s {$sel:resourceId:PutMethod' :: Text
resourceId = Text
a} :: PutMethod)
putMethod_httpMethod :: Lens.Lens' PutMethod Prelude.Text
putMethod_httpMethod :: (Text -> f Text) -> PutMethod -> f PutMethod
putMethod_httpMethod = (PutMethod -> Text)
-> (PutMethod -> Text -> PutMethod)
-> Lens PutMethod PutMethod Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMethod' {Text
httpMethod :: Text
$sel:httpMethod:PutMethod' :: PutMethod -> Text
httpMethod} -> Text
httpMethod) (\s :: PutMethod
s@PutMethod' {} Text
a -> PutMethod
s {$sel:httpMethod:PutMethod' :: Text
httpMethod = Text
a} :: PutMethod)
putMethod_authorizationType :: Lens.Lens' PutMethod Prelude.Text
putMethod_authorizationType :: (Text -> f Text) -> PutMethod -> f PutMethod
putMethod_authorizationType = (PutMethod -> Text)
-> (PutMethod -> Text -> PutMethod)
-> Lens PutMethod PutMethod Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMethod' {Text
authorizationType :: Text
$sel:authorizationType:PutMethod' :: PutMethod -> Text
authorizationType} -> Text
authorizationType) (\s :: PutMethod
s@PutMethod' {} Text
a -> PutMethod
s {$sel:authorizationType:PutMethod' :: Text
authorizationType = Text
a} :: PutMethod)
instance Core.AWSRequest PutMethod where
type AWSResponse PutMethod = Method
request :: PutMethod -> Request PutMethod
request = Service -> PutMethod -> Request PutMethod
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutMethod
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutMethod)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse PutMethod))
-> Logger
-> Service
-> Proxy PutMethod
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutMethod)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> Object -> Either String Method
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable PutMethod
instance Prelude.NFData PutMethod
instance Core.ToHeaders PutMethod where
toHeaders :: PutMethod -> ResponseHeaders
toHeaders =
ResponseHeaders -> PutMethod -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Accept"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
]
)
instance Core.ToJSON PutMethod where
toJSON :: PutMethod -> Value
toJSON PutMethod' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Bool)
Maybe (HashMap Text Text)
Text
authorizationType :: Text
httpMethod :: Text
resourceId :: Text
restApiId :: Text
apiKeyRequired :: Maybe Bool
operationName :: Maybe Text
authorizerId :: Maybe Text
requestParameters :: Maybe (HashMap Text Bool)
requestModels :: Maybe (HashMap Text Text)
requestValidatorId :: Maybe Text
authorizationScopes :: Maybe [Text]
$sel:authorizationType:PutMethod' :: PutMethod -> Text
$sel:httpMethod:PutMethod' :: PutMethod -> Text
$sel:resourceId:PutMethod' :: PutMethod -> Text
$sel:restApiId:PutMethod' :: PutMethod -> Text
$sel:apiKeyRequired:PutMethod' :: PutMethod -> Maybe Bool
$sel:operationName:PutMethod' :: PutMethod -> Maybe Text
$sel:authorizerId:PutMethod' :: PutMethod -> Maybe Text
$sel:requestParameters:PutMethod' :: PutMethod -> Maybe (HashMap Text Bool)
$sel:requestModels:PutMethod' :: PutMethod -> Maybe (HashMap Text Text)
$sel:requestValidatorId:PutMethod' :: PutMethod -> Maybe Text
$sel:authorizationScopes:PutMethod' :: PutMethod -> 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
"requestValidatorId" 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
requestValidatorId,
(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
"requestParameters" Text -> HashMap Text Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HashMap Text Bool -> Pair)
-> Maybe (HashMap Text Bool) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Bool)
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
"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,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"authorizationType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
authorizationType)
]
)
instance Core.ToPath PutMethod where
toPath :: PutMethod -> ByteString
toPath PutMethod' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Bool)
Maybe (HashMap Text Text)
Text
authorizationType :: Text
httpMethod :: Text
resourceId :: Text
restApiId :: Text
apiKeyRequired :: Maybe Bool
operationName :: Maybe Text
authorizerId :: Maybe Text
requestParameters :: Maybe (HashMap Text Bool)
requestModels :: Maybe (HashMap Text Text)
requestValidatorId :: Maybe Text
authorizationScopes :: Maybe [Text]
$sel:authorizationType:PutMethod' :: PutMethod -> Text
$sel:httpMethod:PutMethod' :: PutMethod -> Text
$sel:resourceId:PutMethod' :: PutMethod -> Text
$sel:restApiId:PutMethod' :: PutMethod -> Text
$sel:apiKeyRequired:PutMethod' :: PutMethod -> Maybe Bool
$sel:operationName:PutMethod' :: PutMethod -> Maybe Text
$sel:authorizerId:PutMethod' :: PutMethod -> Maybe Text
$sel:requestParameters:PutMethod' :: PutMethod -> Maybe (HashMap Text Bool)
$sel:requestModels:PutMethod' :: PutMethod -> Maybe (HashMap Text Text)
$sel:requestValidatorId:PutMethod' :: PutMethod -> Maybe Text
$sel:authorizationScopes:PutMethod' :: PutMethod -> Maybe [Text]
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/restapis/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
restApiId,
ByteString
"/resources/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
resourceId,
ByteString
"/methods/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
httpMethod
]
instance Core.ToQuery PutMethod where
toQuery :: PutMethod -> QueryString
toQuery = QueryString -> PutMethod -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty