put_method_response
¶
put_method_response(
rest_api_id: String,
resource_id: String,
http_method: String,
status_code: StatusCode,
*,
config_overrides: Optional[APIGatewayClientConfig] = 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/api_gateway.py
6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 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 | |