Skip to content

test_invoke_method

Operation

test_invoke_method

test_invoke_method(request: TestInvokeMethodInput | TestInvokeMethodInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[TestInvokeMethodInputDict]) -> TestInvokeMethodOutput

Simulate the invocation of a Method in your RestApi with headers, parameters, and an incoming request body.

Parameters:

Name Type Description Default
request TestInvokeMethodInput | TestInvokeMethodInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[TestInvokeMethodInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
TestInvokeMethodOutput

An instance of TestInvokeMethodOutput.

test_invoke_method async

test_invoke_method(request: TestInvokeMethodInput | TestInvokeMethodInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[TestInvokeMethodInputDict]) -> TestInvokeMethodOutput

Simulate the invocation of a Method in your RestApi with headers, parameters, and an incoming request body.

Parameters:

Name Type Description Default
request TestInvokeMethodInput | TestInvokeMethodInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[TestInvokeMethodInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
TestInvokeMethodOutput

An instance of TestInvokeMethodOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

TestInvokeMethodInputDict

Bases: TypedDict

Dictionary form of TestInvokeMethodInput.

Attributes

body instance-attribute
body: str | None

The simulated request body of an incoming invocation request.

client_certificate_id instance-attribute
client_certificate_id: str | None

A ClientCertificate identifier to use in the test invocation. API Gateway will use the certificate when making the HTTPS request to the defined back-end endpoint.

headers instance-attribute
headers: Mapping[str, str] | None

A key-value map of headers to simulate an incoming invocation request.

http_method instance-attribute
http_method: Required[str]

Specifies a test invoke method request's HTTP method.

multi_value_headers instance-attribute
multi_value_headers: Mapping[str, Sequence[str]] | None

The headers as a map from string to list of values to simulate an incoming invocation request.

path_with_query_string instance-attribute
path_with_query_string: str | None

The URI path, including query string, of the simulated invocation request. Use this to specify path parameters and query string parameters.

resource_id instance-attribute
resource_id: Required[str]

Specifies a test invoke method request's resource ID.

rest_api_id instance-attribute
rest_api_id: Required[str]

The string identifier of the associated RestApi.

stage_variables instance-attribute
stage_variables: Mapping[str, str] | None

A key-value map of stage variables to simulate an invocation on a deployed Stage.

TestInvokeMethodInput dataclass

Bases: _SerdeShape

Make a request to simulate the invocation of a Method.

Attributes

body class-attribute instance-attribute
body: str | None = ...

The simulated request body of an incoming invocation request.

client_certificate_id class-attribute instance-attribute
client_certificate_id: str | None = ...

A ClientCertificate identifier to use in the test invocation. API Gateway will use the certificate when making the HTTPS request to the defined back-end endpoint.

headers class-attribute instance-attribute
headers: dict[str, str] | None = ...

A key-value map of headers to simulate an incoming invocation request.

http_method class-attribute instance-attribute
http_method: str | None = ...

Specifies a test invoke method request's HTTP method.

multi_value_headers class-attribute instance-attribute
multi_value_headers: dict[str, list[str]] | None = ...

The headers as a map from string to list of values to simulate an incoming invocation request.

path_with_query_string class-attribute instance-attribute
path_with_query_string: str | None = ...

The URI path, including query string, of the simulated invocation request. Use this to specify path parameters and query string parameters.

resource_id class-attribute instance-attribute
resource_id: str | None = ...

Specifies a test invoke method request's resource ID.

rest_api_id class-attribute instance-attribute
rest_api_id: str | None = ...

The string identifier of the associated RestApi.

stage_variables class-attribute instance-attribute
stage_variables: dict[str, str] | None = ...

A key-value map of stage variables to simulate an invocation on a deployed Stage.

Output

TestInvokeMethodOutput dataclass

Bases: _SerdeShape

Represents the response of the test invoke request in the HTTP method.

Attributes

body class-attribute instance-attribute
body: str | None = ...

The body of the HTTP response.

headers class-attribute instance-attribute
headers: dict[str, str] | None = ...

The headers of the HTTP response.

latency class-attribute instance-attribute
latency: int = ...

The execution latency, in ms, of the test invoke request.

log class-attribute instance-attribute
log: str | None = ...

The API Gateway execution log for the test invoke request.

multi_value_headers class-attribute instance-attribute
multi_value_headers: dict[str, list[str]] | None = ...

The headers of the HTTP response as a map from string to list of values.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

status class-attribute instance-attribute
status: int = ...

The HTTP status code.