Skip to content

APIGatewayClient.put_method

rboto-api-gateway==0.4.0 · Service index · Types

Model summary (excerpt): Add a method to an existing Resource resource.

Install and imports

python -m pip install "rboto[api-gateway]==0.4.0"
from rboto import APIGatewayClient
from collections.abc import Sequence
from rboto_api_gateway.types import (
    PutMethodOutput,
)

Signature

async def put_method(
    *,
    rest_api_id: str,
    resource_id: str,
    http_method: str,
    authorization_type: str,
    authorizer_id: str | None = None,
    api_key_required: bool | None = None,
    operation_name: str | None = None,
    request_parameters: dict[str, bool] | None = None,
    request_models: dict[str, str] | None = None,
    request_validator_id: str | None = None,
    authorization_scopes: Sequence[str] | None = None,
) -> PutMethodOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
rest_api_id Yes The string identifier of the associated RestApi.
resource_id Yes The Resource identifier for the new Method resource.
http_method Yes Specifies the method request's HTTP method type.
authorization_type Yes The method's authorization type. Valid values are NONE for open access, AWS_IAM for using Amazon Web Services IAM permissions, CUSTOM for using a custom authorizer, COGNITO_USER_POOLS for using a Cognito user pool, or JWT for using a JWT authorizer.
authorizer_id No Specifies the identifier of an Authorizer to use on this Method, if the type is CUSTOM or COGNITO_USER_POOLS. The authorizer identifier is generated by API Gateway when you created the authorizer.
api_key_required No Specifies whether the method required a valid ApiKey.
operation_name No A human-friendly operation identifier for the method. For example, you can assign the operationName of ListPets for the GET /pets method in the PetStore example.
request_parameters No A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key defines a method request parameter name matching the pattern of method.request.{location}.{name} , where location is querystring , path , or header and name is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter...
request_models No Specifies the Model resources used for the request's content type. Request models are represented as a key/value map, with a content type as the key and a Model name as the value.
request_validator_id No The identifier of a RequestValidator for validating the method request.
authorization_scopes No A list of authorization scopes configured on the method. The scopes are used with a COGNITO_USER_POOLS authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the...

Output

PutMethodOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
http_method str | None Always present —
authorization_type str | None Always present —
authorizer_id str | None Always present —
api_key_required bool | None Always present —
request_validator_id str | None Always present —
operation_name str | None Always present —
request_parameters dict[str, bool] | None Always present —
request_models dict[str, str] | None Always present —
method_responses dict[str, MethodResponse] | None Always present MethodResponse
method_integration Integration | None Always present Integration
authorization_scopes list[str] | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

PutMethodOutput

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_api_gateway.exceptions:

BadRequestError, ConflictError, LimitExceededError, NotFoundError, TooManyRequestsError, UnauthorizedError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model