Skip to content

update_route_response

update_route_response(
    api_id: __string,
    route_id: __string,
    route_response_id: __string,
    *,
    config_overrides: Optional[ApiGatewayV2ClientConfig] = None,
    model_selection_expression: Optional[SelectionExpression] = None,
    response_models: Optional[RouteModels] = None,
    response_parameters: Optional[RouteParameters] = None,
    route_response_key: Optional[SelectionKey] = None,
) -> UpdateRouteResponseResponse

Updates a RouteResponse.

Parameters:

  • api_id (__string) –

    The API identifier.

  • model_selection_expression (Optional[SelectionExpression], default: None ) –

    The model selection expression for the route response. Supported only for WebSocket APIs.

  • response_models (Optional[RouteModels], default: None ) –

    The response models for the route response.

  • response_parameters (Optional[RouteParameters], default: None ) –

    The route response parameters.

  • route_id (__string) –

    The route ID.

  • route_response_id (__string) –

    The route response ID.

  • route_response_key (Optional[SelectionKey], default: None ) –

    The route response key.

Raises:

  • BadRequestException –

    The request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.

  • ConflictException –

    The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.

  • NotFoundException –

    The resource specified in the request was not found. See the message field for more information.

  • TooManyRequestsException –

    A limit has been exceeded. See the accompanying error message for details.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_apigatewayv2/_services/api_gateway_v2.py
def update_route_response(
    self,
    api_id: "capo_apigatewayv2.types.__string.__string",
    route_id: "capo_apigatewayv2.types.__string.__string",
    route_response_id: "capo_apigatewayv2.types.__string.__string",
    *,
    config_overrides: Optional[ApiGatewayV2ClientConfig] = None,
    model_selection_expression: Optional[
        "capo_apigatewayv2.types.selection_expression.SelectionExpression"
    ] = None,
    response_models: Optional[
        "capo_apigatewayv2.types.route_models.RouteModels"
    ] = None,
    response_parameters: Optional[
        "capo_apigatewayv2.types.route_parameters.RouteParameters"
    ] = None,
    route_response_key: Optional[
        "capo_apigatewayv2.types.selection_key.SelectionKey"
    ] = None,
) -> "capo_apigatewayv2.types.update_route_response_response.UpdateRouteResponseResponse":
    """<p>Updates a RouteResponse.</p>

    Args:
        api_id: <p>The API identifier.</p>
        model_selection_expression: <p>The model selection expression for the route response. Supported only for WebSocket APIs.</p>
        response_models: <p>The response models for the route response.</p>
        response_parameters: <p>The route response parameters.</p>
        route_id: <p>The route ID.</p>
        route_response_id: <p>The route response ID.</p>
        route_response_key: <p>The route response key.</p>

    Raises:
        capo_apigatewayv2.errors.bad_request_exception.BadRequestException: <p>The request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.</p>
        capo_apigatewayv2.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.</p>
        capo_apigatewayv2.errors.not_found_exception.NotFoundException: <p>The resource specified in the request was not found. See the message field for more information.</p>
        capo_apigatewayv2.errors.too_many_requests_exception.TooManyRequestsException: <p>A limit has been exceeded. See the accompanying error message for details.</p>
        capo_apigatewayv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_apigatewayv2.types.update_route_response_request.UpdateRouteResponseRequest]",
    ) -> OperationResponse[
        "capo_apigatewayv2.types.update_route_response_response.UpdateRouteResponseResponse"
    ]:
        import capo_apigatewayv2._operations.api_gateway_v2.update_route_response

        output, http_response = (
            capo_apigatewayv2._operations.api_gateway_v2.update_route_response.update_route_response(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateRouteResponse")
    )
    input_: capo_apigatewayv2.types.update_route_response_request.UpdateRouteResponseRequest = {
        "api_id": api_id,
        "route_id": route_id,
        "route_response_id": route_response_id,
    }
    if model_selection_expression is not None:
        input_["model_selection_expression"] = model_selection_expression
    if response_models is not None:
        input_["response_models"] = response_models
    if response_parameters is not None:
        input_["response_parameters"] = response_parameters
    if route_response_key is not None:
        input_["route_response_key"] = route_response_key

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output