put_method_response
async
¶
put_method_response(
rest_api_id: String,
resource_id: String,
http_method: String,
status_code: StatusCode,
*,
config_overrides: Optional[AsyncAPIGatewayClientConfig] = None,
response_parameters: Optional[MapOfStringToBoolean] = None,
response_models: Optional[MapOfStringToString] = None,
) -> MethodResponse
Adds a MethodResponse to an existing Method resource.
Parameters:
-
rest_api_id(String) –The string identifier of the associated RestApi.
-
resource_id(String) –The Resource identifier for the Method resource.
-
http_method(String) –The HTTP verb of the Method resource.
-
status_code(StatusCode) –The method response's status code.
-
response_parameters(Optional[MapOfStringToBoolean], default:None) –A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header name and the associated value is a Boolean flag indicating whether the method response parameter is required or not. The method response header names must match the pattern of
method.response.header.{name}, wherenameis a valid and unique header name. The response parameter names defined here are available in the integration response to be mapped from an integration response header expressed inintegration.response.header.{name}, a static value enclosed within a pair of single quotes (e.g.,'application/json'), or a JSON expression from the back-end response payload in the form ofintegration.response.body.{JSON-expression}, whereJSON-expressionis a valid JSON expression without the$prefix.) -
response_models(Optional[MapOfStringToString], default:None) –Specifies the Model resources used for the response's content type. Response models are represented as a key/value map, with a content type as the key and a Model name as the value.
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
6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 | |