test_invoke_method¶
Operation¶
test_invoke_method
async
¶
test_invoke_method(input: TestInvokeMethodInput, plugins: list[Plugin] | None = None) -> TestInvokeMethodOutput
Simulate the invocation of a Method in your RestApi with headers, parameters, and an incoming request body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
TestInvokeMethodInput
|
An instance of |
required |
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
|
Returns:
| Type | Description |
|---|---|
TestInvokeMethodOutput
|
An instance of |
Input¶
TestInvokeMethodInput
dataclass
¶
Make a request to simulate the invocation of a Method.
Attributes¶
body
class-attribute
instance-attribute
¶
body: str | None = None
The simulated request body of an incoming invocation request.
client_certificate_id
class-attribute
instance-attribute
¶
client_certificate_id: str | None = 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 = None
A key-value map of headers to simulate an incoming invocation request.
http_method
class-attribute
instance-attribute
¶
http_method: str | None = 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 = 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 = 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 = None
Specifies a test invoke method request's resource ID.
rest_api_id
class-attribute
instance-attribute
¶
rest_api_id: str | None = None
The string identifier of the associated RestApi.
stage_variables
class-attribute
instance-attribute
¶
stage_variables: dict[str, str] | None = None
A key-value map of stage variables to simulate an invocation on a deployed Stage.
Output¶
TestInvokeMethodOutput
dataclass
¶
Represents the response of the test invoke request in the HTTP method.
Attributes¶
headers
class-attribute
instance-attribute
¶
headers: dict[str, str] | None = None
The headers of the HTTP response.
latency
class-attribute
instance-attribute
¶
latency: int = 0
The execution latency, in ms, of the test invoke request.
log
class-attribute
instance-attribute
¶
log: str | None = 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 = None
The headers of the HTTP response as a map from string to list of values.