update_integration_response

update_integration_response(**kwargs)

Represents an update integration response.

See also: AWS API Documentation

Request Syntax

response = client.update_integration_response(
    restApiId='string',
    resourceId='string',
    httpMethod='string',
    statusCode='string',
    patchOperations=[
        {
            'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
            'path': 'string',
            'value': 'string',
            'from': 'string'
        },
    ]
)
Parameters
  • restApiId (string) --

    [REQUIRED]

    The string identifier of the associated RestApi.

  • resourceId (string) --

    [REQUIRED]

    Specifies an update integration response request's resource identifier.

  • httpMethod (string) --

    [REQUIRED]

    Specifies an update integration response request's HTTP method.

  • statusCode (string) --

    [REQUIRED]

    Specifies an update integration response request's status code.

  • patchOperations (list) --

    For more information about supported patch operations, see Patch Operations.

    • (dict) --

      For more information about supported patch operations, see Patch Operations.

      • op (string) --

        An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..

      • path (string) --

        The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.

      • value (string) --

        The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.

      • from (string) --

        The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".

Return type

dict

Returns

Response Syntax

{
    'statusCode': 'string',
    'selectionPattern': 'string',
    'responseParameters': {
        'string': 'string'
    },
    'responseTemplates': {
        'string': 'string'
    },
    'contentHandling': 'CONVERT_TO_BINARY'|'CONVERT_TO_TEXT'
}

Response Structure

  • (dict) --

    Represents an integration response. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.

    • statusCode (string) --

      Specifies the status code that is used to map the integration response to an existing MethodResponse.

    • selectionPattern (string) --

      Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+ regex to match error response. However, make sure that the error response does not contain any newline ( \n ) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.

    • responseParameters (dict) --

      A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name} , where name is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name} or integration.response.body.{JSON-expression} , where name is a valid and unique response header name and JSON-expression is a valid JSON expression without the $ prefix.

      • (string) --
        • (string) --
    • responseTemplates (dict) --

      Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.

      • (string) --
        • (string) --
    • contentHandling (string) --

      Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT , with the following behaviors:

      If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.

Exceptions

  • APIGateway.Client.exceptions.BadRequestException
  • APIGateway.Client.exceptions.ConflictException
  • APIGateway.Client.exceptions.LimitExceededException
  • APIGateway.Client.exceptions.NotFoundException
  • APIGateway.Client.exceptions.UnauthorizedException
  • APIGateway.Client.exceptions.TooManyRequestsException