put_method
async
¶
put_method(
rest_api_id: String,
resource_id: String,
http_method: String,
authorization_type: String,
*,
config_overrides: Optional[AsyncAPIGatewayClientConfig] = None,
authorizer_id: Optional[String] = None,
api_key_required: Optional[Boolean] = None,
operation_name: Optional[String] = None,
request_parameters: Optional[MapOfStringToBoolean] = None,
request_models: Optional[MapOfStringToString] = None,
request_validator_id: Optional[String] = None,
authorization_scopes: Optional[ListOfString] = None,
) -> Method
Add a method to an existing Resource resource.
Parameters:
-
rest_api_id(String) –The string identifier of the associated RestApi.
-
resource_id(String) –The Resource identifier for the new Method resource.
-
http_method(String) –Specifies the method request's HTTP method type.
-
authorization_type(String) –The method's authorization type. Valid values are
NONEfor open access,AWS_IAMfor using AWS IAM permissions,CUSTOMfor using a custom authorizer, orCOGNITO_USER_POOLSfor using a Cognito user pool. -
authorizer_id(Optional[String], default:None) –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(Optional[Boolean], default:None) –Specifies whether the method required a valid ApiKey.
-
operation_name(Optional[String], default:None) –A human-friendly operation identifier for the method. For example, you can assign the
operationNameofListPetsfor theGET /petsmethod in thePetStoreexample. -
request_parameters(Optional[MapOfStringToBoolean], default:None) –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}, wherelocationisquerystring,path, orheaderandnameis a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (true) or optional (false). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or body-mapping templates. -
request_models(Optional[MapOfStringToString], default:None) –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(Optional[String], default:None) –The identifier of a RequestValidator for validating the method request.
-
authorization_scopes(Optional[ListOfString], default:None) –A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLSauthorizer 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 invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
Raises:
-
BadRequestException–The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.
-
ConflictException–The request configuration has conflicts. For details, see the accompanying error message.
-
LimitExceededException–The request exceeded the rate limit. Retry after the specified time period.
-
NotFoundException–The requested resource is not found. Make sure that the request URI is correct.
-
TooManyRequestsException–The request has reached its throttling limit. Retry after the specified time period.
-
UnauthorizedException–The request is denied because the caller has insufficient permissions.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_api_gateway/_services/async_api_gateway.py
6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 | |