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 |
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 |
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
¶
A key-value map of headers to simulate an incoming invocation request.
http_method
instance-attribute
¶
Specifies a test invoke method request's HTTP method.
multi_value_headers
instance-attribute
¶
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
¶
Specifies a test invoke method request's resource ID.
rest_api_id
instance-attribute
¶
The string identifier of the associated RestApi.
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
¶
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
¶
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.
Output¶
TestInvokeMethodOutput
dataclass
¶
Bases: _SerdeShape
Represents the response of the test invoke request in the HTTP method.
Attributes¶
headers
class-attribute
instance-attribute
¶
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
¶
The headers of the HTTP response as a map from string to list of values.
response_metadata
class-attribute
instance-attribute
¶
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.