APIGatewayClient.test_invoke_method
rboto-api-gateway==0.4.0 · Service index · Types
Model summary (excerpt): Simulate the invocation of a Method in your RestApi with headers, parameters, and an incoming request body.
Install and imports
from rboto import APIGatewayClient
from collections.abc import Sequence
from rboto_api_gateway.types import (
TestInvokeMethodOutput,
)
Signature
async def test_invoke_method(
*,
rest_api_id: str,
resource_id: str,
http_method: str,
path_with_query_string: str | None = None,
body: str | None = None,
headers: dict[str, str] | None = None,
multi_value_headers: dict[str, Sequence[str]] | None = None,
client_certificate_id: str | None = None,
stage_variables: dict[str, str] | None = None,
) -> TestInvokeMethodOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
rest_api_id |
Yes | The string identifier of the associated RestApi. |
resource_id |
Yes | Specifies a test invoke method request's resource ID. |
http_method |
Yes | Specifies a test invoke method request's HTTP method. |
path_with_query_string |
No | The URI path, including query string, of the simulated invocation request. Use this to specify path parameters and query string parameters. |
body |
No | The simulated request body of an incoming invocation request. |
headers |
No | A key-value map of headers to simulate an incoming invocation request. |
multi_value_headers |
No | The headers as a map from string to list of values to simulate an incoming invocation request. |
client_certificate_id |
No | 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. |
stage_variables |
No | A key-value map of stage variables to simulate an invocation on a deployed Stage. |
Output
TestInvokeMethodOutput.
Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.
| Field | Type | Presence | References |
|---|---|---|---|
status |
int |
Always present | — |
body |
str | None |
Always present | — |
headers |
dict[str, str] | None |
Always present | — |
multi_value_headers |
dict[str, list[str]] | None |
Always present | — |
log |
str | None |
Always present | — |
latency |
int |
Always present | — |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
No output stream.
Errors
Import from rboto_api_gateway.exceptions:
BadRequestError, NotFoundError, TooManyRequestsError, UnauthorizedError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.