capo-lambda 0.26.0__py3-none-any.whl → 0.28.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- capo_lambda/_operations/aws_gir_api_service/create_function.py +2 -0
- capo_lambda/_operations/aws_gir_api_service/delete_durable_execution.py +175 -0
- capo_lambda/_operations/aws_gir_api_service/get_durable_execution.py +1 -0
- capo_lambda/_operations/aws_gir_api_service/get_function_configuration.py +2 -0
- capo_lambda/_operations/aws_gir_api_service/invoke.py +10 -0
- capo_lambda/_operations/aws_gir_api_service/invoke_with_response_stream.py +10 -0
- capo_lambda/_operations/aws_gir_api_service/pause_durable_execution.py +194 -0
- capo_lambda/_operations/aws_gir_api_service/publish_version.py +2 -0
- capo_lambda/_operations/aws_gir_api_service/remove_layer_version_permission.py +5 -0
- capo_lambda/_operations/aws_gir_api_service/resume_durable_execution.py +194 -0
- capo_lambda/_operations/aws_gir_api_service/update_function_code.py +2 -0
- capo_lambda/_operations/aws_gir_api_service/update_function_configuration.py +2 -0
- capo_lambda/_resources/aws_gir_api_service/durable_execution.py +412 -2
- capo_lambda/_resources/aws_gir_api_service/event_source_mapping.py +12 -12
- capo_lambda/_resources/aws_gir_api_service/function.py +78 -16
- capo_lambda/_resources/aws_gir_api_service/function_version_resource.py +4 -4
- capo_lambda/_resources/aws_gir_api_service/layer_version.py +17 -15
- capo_lambda/_resources/aws_gir_api_service/provisioned_concurrency_config.py +8 -8
- capo_lambda/_services/_aws_config.py +15 -0
- capo_lambda/_services/_lambda.py +283 -31
- capo_lambda/_services/_pipeline.py +207 -0
- capo_lambda/_services/async__lambda.py +286 -31
- capo_lambda/errors/__init__.py +6 -0
- capo_lambda/errors/runtime_alias_deleted_exception.py +65 -0
- capo_lambda/errors/runtime_version_deleted_exception.py +65 -0
- capo_lambda/types/accelerator_config.py +47 -0
- capo_lambda/types/accelerator_memory_gb.py +21 -0
- capo_lambda/types/add_layer_version_permission_request.py +2 -2
- capo_lambda/types/capacity_provider_predefined_metric_type.py +1 -0
- capo_lambda/types/chained_invoke_options.py +1 -1
- capo_lambda/types/create_event_source_mapping_request.py +4 -4
- capo_lambda/types/create_function_request.py +39 -1
- capo_lambda/types/delete_durable_execution_request.py +24 -0
- capo_lambda/types/delete_durable_execution_response.py +47 -0
- capo_lambda/types/delete_layer_version_request.py +2 -2
- capo_lambda/types/event.py +58 -0
- capo_lambda/types/event_pause_reason.py +42 -0
- capo_lambda/types/event_resume_reason.py +42 -0
- capo_lambda/types/event_type.py +2 -0
- capo_lambda/types/execution_paused_details.py +79 -0
- capo_lambda/types/execution_resumed_details.py +71 -0
- capo_lambda/types/execution_status.py +3 -0
- capo_lambda/types/execution_timeout_paused.py +5 -0
- capo_lambda/types/function_configuration.py +39 -1
- capo_lambda/types/function_runtime_alias.py +5 -0
- capo_lambda/types/function_runtime_arn.py +5 -0
- capo_lambda/types/function_runtime_config.py +37 -0
- capo_lambda/types/get_durable_execution_response.py +42 -1
- capo_lambda/types/get_layer_version_policy_request.py +2 -2
- capo_lambda/types/get_layer_version_request.py +2 -2
- capo_lambda/types/kafka_event_source_mapping_consumption_mode.py +17 -0
- capo_lambda/types/last_update_status_reason_code.py +1 -0
- capo_lambda/types/layer_name_or_arn.py +5 -0
- capo_lambda/types/list_durable_executions_by_function_request.py +1 -1
- capo_lambda/types/list_layer_versions_request.py +2 -2
- capo_lambda/types/pause_details.py +67 -0
- capo_lambda/types/pause_durable_execution_request.py +54 -0
- capo_lambda/types/pause_durable_execution_response.py +18 -0
- capo_lambda/types/pause_reason.py +5 -0
- capo_lambda/types/publish_layer_version_request.py +2 -2
- capo_lambda/types/remove_layer_version_permission_request.py +2 -2
- capo_lambda/types/resume_durable_execution_request.py +45 -0
- capo_lambda/types/resume_durable_execution_response.py +18 -0
- capo_lambda/types/resume_reason.py +5 -0
- capo_lambda/types/runtime.py +1 -0
- capo_lambda/types/self_managed_kafka_event_source_config.py +21 -0
- capo_lambda/types/state_reason_code.py +1 -0
- capo_lambda/types/update_event_source_mapping_request.py +2 -2
- capo_lambda/types/update_function_configuration_request.py +39 -1
- {capo_lambda-0.26.0.dist-info → capo_lambda-0.28.0.dist-info}/METADATA +3 -1
- {capo_lambda-0.26.0.dist-info → capo_lambda-0.28.0.dist-info}/RECORD +74 -48
- {capo_lambda-0.26.0.dist-info → capo_lambda-0.28.0.dist-info}/WHEEL +0 -0
- {capo_lambda-0.26.0.dist-info → capo_lambda-0.28.0.dist-info}/licenses/LICENSE +0 -0
- {capo_lambda-0.26.0.dist-info → capo_lambda-0.28.0.dist-info}/top_level.txt +0 -0
|
@@ -21,6 +21,7 @@ import capo_lambda.errors.resource_conflict_exception
|
|
|
21
21
|
import capo_lambda.errors.resource_not_found_exception
|
|
22
22
|
import capo_lambda.errors.service_exception
|
|
23
23
|
import capo_lambda.errors.too_many_requests_exception
|
|
24
|
+
import capo_lambda.types.accelerator_config
|
|
24
25
|
import capo_lambda.types.architectures_list
|
|
25
26
|
import capo_lambda.types.capacity_provider_config
|
|
26
27
|
import capo_lambda.types.create_function_request
|
|
@@ -32,6 +33,7 @@ import capo_lambda.types.ephemeral_storage
|
|
|
32
33
|
import capo_lambda.types.file_system_config_list
|
|
33
34
|
import capo_lambda.types.function_code
|
|
34
35
|
import capo_lambda.types.function_configuration
|
|
36
|
+
import capo_lambda.types.function_runtime_config
|
|
35
37
|
import capo_lambda.types.function_version_latest_published
|
|
36
38
|
import capo_lambda.types.image_config
|
|
37
39
|
import capo_lambda.types.image_config_response
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.lambda#DeleteDurableExecution``."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from typing import Any
|
|
7
|
+
from urllib.parse import quote
|
|
8
|
+
|
|
9
|
+
import zapros
|
|
10
|
+
from typing_extensions import Never
|
|
11
|
+
|
|
12
|
+
import capo_lambda._auth._signers
|
|
13
|
+
import capo_lambda._auth._sigv4
|
|
14
|
+
import capo_lambda._protocol.eventstream
|
|
15
|
+
import capo_lambda.errors.invalid_parameter_value_exception
|
|
16
|
+
import capo_lambda.errors.resource_conflict_exception
|
|
17
|
+
import capo_lambda.errors.resource_not_found_exception
|
|
18
|
+
import capo_lambda.errors.service_exception
|
|
19
|
+
import capo_lambda.errors.too_many_requests_exception
|
|
20
|
+
import capo_lambda.types.delete_durable_execution_request
|
|
21
|
+
import capo_lambda.types.delete_durable_execution_response
|
|
22
|
+
import capo_lambda.types.execution_timestamp
|
|
23
|
+
from capo_lambda._protocol.errors import parse_error_metadata_json
|
|
24
|
+
from capo_lambda._rule_engine._endpoint_rule_set import EndpointParams, resolve
|
|
25
|
+
from capo_lambda._services._pipeline import (
|
|
26
|
+
AsyncOperationOptions,
|
|
27
|
+
OperationOptions,
|
|
28
|
+
raise_error,
|
|
29
|
+
)
|
|
30
|
+
from capo_lambda.errors import UnknownServiceError
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def handle_error(response: zapros.Response) -> Never:
|
|
34
|
+
data = json.loads(response.read())
|
|
35
|
+
code, message = parse_error_metadata_json(response, data)
|
|
36
|
+
match code:
|
|
37
|
+
case "InvalidParameterValueException":
|
|
38
|
+
raise capo_lambda.errors.invalid_parameter_value_exception.InvalidParameterValueException.from_json(
|
|
39
|
+
data, message, response=response
|
|
40
|
+
)
|
|
41
|
+
case "ResourceConflictException":
|
|
42
|
+
raise capo_lambda.errors.resource_conflict_exception.ResourceConflictException.from_json(
|
|
43
|
+
data, message, response=response
|
|
44
|
+
)
|
|
45
|
+
case "ResourceNotFoundException":
|
|
46
|
+
raise capo_lambda.errors.resource_not_found_exception.ResourceNotFoundException.from_json(
|
|
47
|
+
data, message, response=response
|
|
48
|
+
)
|
|
49
|
+
case "ServiceException":
|
|
50
|
+
raise capo_lambda.errors.service_exception.ServiceException.from_json(
|
|
51
|
+
data, message, response=response
|
|
52
|
+
)
|
|
53
|
+
case "TooManyRequestsException":
|
|
54
|
+
raise capo_lambda.errors.too_many_requests_exception.TooManyRequestsException.from_json(
|
|
55
|
+
data, message, response=response
|
|
56
|
+
)
|
|
57
|
+
case _:
|
|
58
|
+
raise UnknownServiceError(code=code, message=message, response=response)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def handle_response(
|
|
62
|
+
response: zapros.Response,
|
|
63
|
+
) -> capo_lambda.types.delete_durable_execution_response.DeleteDurableExecutionResponse:
|
|
64
|
+
out: capo_lambda.types.delete_durable_execution_response.DeleteDurableExecutionResponse = capo_lambda.types.delete_durable_execution_response.deserialize_json(
|
|
65
|
+
json.loads(response.read())
|
|
66
|
+
)
|
|
67
|
+
return out
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
async def async_handle_response(
|
|
71
|
+
response: zapros.Response,
|
|
72
|
+
) -> capo_lambda.types.delete_durable_execution_response.DeleteDurableExecutionResponse:
|
|
73
|
+
out: capo_lambda.types.delete_durable_execution_response.DeleteDurableExecutionResponse = capo_lambda.types.delete_durable_execution_response.deserialize_json(
|
|
74
|
+
json.loads(await response.aread())
|
|
75
|
+
)
|
|
76
|
+
return out
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def get_signer(
|
|
80
|
+
options: AsyncOperationOptions | OperationOptions,
|
|
81
|
+
auth_schemes: list[dict[str, Any]] | None = None,
|
|
82
|
+
) -> capo_lambda._auth._signers.Signer | None:
|
|
83
|
+
name_to_schema = {s["name"]: s for s in (auth_schemes or [])} # noqa: F841
|
|
84
|
+
if (
|
|
85
|
+
options.credentials_provider is not None
|
|
86
|
+
and name_to_schema
|
|
87
|
+
and not name_to_schema.keys() & {"sigv4", "sigv4-s3express"}
|
|
88
|
+
):
|
|
89
|
+
raise RuntimeError(
|
|
90
|
+
"Endpoint requires an unsupported auth scheme: " + ", ".join(name_to_schema)
|
|
91
|
+
)
|
|
92
|
+
if options.credentials_provider is not None:
|
|
93
|
+
endpoint_scheme = name_to_schema.get("sigv4") or name_to_schema.get(
|
|
94
|
+
"sigv4-s3express"
|
|
95
|
+
)
|
|
96
|
+
if endpoint_scheme is not None or not name_to_schema:
|
|
97
|
+
sigv4_config = capo_lambda._auth._sigv4.build_sigv4_auth_scheme(
|
|
98
|
+
"lambda", options.region, endpoint_scheme
|
|
99
|
+
)
|
|
100
|
+
if sigv4_config is not None:
|
|
101
|
+
return capo_lambda._auth._signers.SigV4Signer(
|
|
102
|
+
options.credentials_provider, auth_scheme=sigv4_config
|
|
103
|
+
)
|
|
104
|
+
raise RuntimeError("Auth was not resolved")
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def build_request(
|
|
108
|
+
options: OperationOptions | AsyncOperationOptions,
|
|
109
|
+
input_: capo_lambda.types.delete_durable_execution_request.DeleteDurableExecutionRequest,
|
|
110
|
+
) -> zapros.Request:
|
|
111
|
+
endpoint = resolve(
|
|
112
|
+
EndpointParams(
|
|
113
|
+
Region=options.region,
|
|
114
|
+
UseDualStack=options.use_dual_stack,
|
|
115
|
+
UseFIPS=options.use_fips,
|
|
116
|
+
Endpoint=options.endpoint,
|
|
117
|
+
)
|
|
118
|
+
) # noqa: F841
|
|
119
|
+
url = (
|
|
120
|
+
endpoint.url.rstrip("/")
|
|
121
|
+
+ "/2025-12-01/durable-executions/{DurableExecutionArn}"
|
|
122
|
+
)
|
|
123
|
+
url = url.replace(
|
|
124
|
+
"{DurableExecutionArn}", quote(input_["durable_execution_arn"], safe="")
|
|
125
|
+
)
|
|
126
|
+
params: list[tuple[str, str]] = []
|
|
127
|
+
headers: dict[str, str] = {k: ", ".join(v) for k, v in endpoint.headers.items()}
|
|
128
|
+
body: bytes | None = b""
|
|
129
|
+
signer = (
|
|
130
|
+
None
|
|
131
|
+
if options.anonymous
|
|
132
|
+
else get_signer(options, auth_schemes=endpoint.properties.get("authSchemes"))
|
|
133
|
+
)
|
|
134
|
+
normalized_url = zapros.URL(url)
|
|
135
|
+
for k, v in params:
|
|
136
|
+
normalized_url.search_params.append(k, v)
|
|
137
|
+
return zapros.Request(
|
|
138
|
+
normalized_url, "DELETE", headers=headers, body=body, context={"signer": signer}
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def delete_durable_execution(
|
|
143
|
+
options: OperationOptions,
|
|
144
|
+
input_: capo_lambda.types.delete_durable_execution_request.DeleteDurableExecutionRequest,
|
|
145
|
+
) -> tuple[
|
|
146
|
+
capo_lambda.types.delete_durable_execution_response.DeleteDurableExecutionResponse,
|
|
147
|
+
zapros.Response,
|
|
148
|
+
]:
|
|
149
|
+
response = options.client.handler.handle(build_request(options, input_))
|
|
150
|
+
try:
|
|
151
|
+
if response.status >= 300:
|
|
152
|
+
response.read()
|
|
153
|
+
raise_error(response, handle_error)
|
|
154
|
+
return handle_response(response), response
|
|
155
|
+
except BaseException:
|
|
156
|
+
response.close()
|
|
157
|
+
raise
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
async def async_delete_durable_execution(
|
|
161
|
+
options: AsyncOperationOptions,
|
|
162
|
+
input_: capo_lambda.types.delete_durable_execution_request.DeleteDurableExecutionRequest,
|
|
163
|
+
) -> tuple[
|
|
164
|
+
capo_lambda.types.delete_durable_execution_response.DeleteDurableExecutionResponse,
|
|
165
|
+
zapros.Response,
|
|
166
|
+
]:
|
|
167
|
+
response = await options.client.handler.ahandle(build_request(options, input_))
|
|
168
|
+
try:
|
|
169
|
+
if response.status >= 300:
|
|
170
|
+
await response.aread()
|
|
171
|
+
raise_error(response, handle_error)
|
|
172
|
+
return await async_handle_response(response), response
|
|
173
|
+
except BaseException:
|
|
174
|
+
await response.aclose()
|
|
175
|
+
raise
|
|
@@ -26,6 +26,7 @@ import capo_lambda.types.execution_status
|
|
|
26
26
|
import capo_lambda.types.execution_timestamp
|
|
27
27
|
import capo_lambda.types.get_durable_execution_request
|
|
28
28
|
import capo_lambda.types.get_durable_execution_response
|
|
29
|
+
import capo_lambda.types.pause_details
|
|
29
30
|
import capo_lambda.types.trace_header
|
|
30
31
|
from capo_lambda._protocol.errors import parse_error_metadata_json
|
|
31
32
|
from capo_lambda._rule_engine._endpoint_rule_set import EndpointParams, resolve
|
|
@@ -16,6 +16,7 @@ import capo_lambda.errors.invalid_parameter_value_exception
|
|
|
16
16
|
import capo_lambda.errors.resource_not_found_exception
|
|
17
17
|
import capo_lambda.errors.service_exception
|
|
18
18
|
import capo_lambda.errors.too_many_requests_exception
|
|
19
|
+
import capo_lambda.types.accelerator_config
|
|
19
20
|
import capo_lambda.types.architectures_list
|
|
20
21
|
import capo_lambda.types.capacity_provider_config
|
|
21
22
|
import capo_lambda.types.dead_letter_config
|
|
@@ -24,6 +25,7 @@ import capo_lambda.types.environment_response
|
|
|
24
25
|
import capo_lambda.types.ephemeral_storage
|
|
25
26
|
import capo_lambda.types.file_system_config_list
|
|
26
27
|
import capo_lambda.types.function_configuration
|
|
28
|
+
import capo_lambda.types.function_runtime_config
|
|
27
29
|
import capo_lambda.types.get_function_configuration_request
|
|
28
30
|
import capo_lambda.types.image_config_response
|
|
29
31
|
import capo_lambda.types.last_update_status
|
|
@@ -42,6 +42,8 @@ import capo_lambda.errors.request_too_large_exception
|
|
|
42
42
|
import capo_lambda.errors.resource_conflict_exception
|
|
43
43
|
import capo_lambda.errors.resource_not_found_exception
|
|
44
44
|
import capo_lambda.errors.resource_not_ready_exception
|
|
45
|
+
import capo_lambda.errors.runtime_alias_deleted_exception
|
|
46
|
+
import capo_lambda.errors.runtime_version_deleted_exception
|
|
45
47
|
import capo_lambda.errors.s3_files_mount_connectivity_exception
|
|
46
48
|
import capo_lambda.errors.s3_files_mount_failure_exception
|
|
47
49
|
import capo_lambda.errors.s3_files_mount_timeout_exception
|
|
@@ -194,6 +196,14 @@ def handle_error(response: zapros.Response) -> Never:
|
|
|
194
196
|
raise capo_lambda.errors.resource_not_ready_exception.ResourceNotReadyException.from_json(
|
|
195
197
|
data, message, response=response
|
|
196
198
|
)
|
|
199
|
+
case "RuntimeAliasDeletedException":
|
|
200
|
+
raise capo_lambda.errors.runtime_alias_deleted_exception.RuntimeAliasDeletedException.from_json(
|
|
201
|
+
data, message, response=response
|
|
202
|
+
)
|
|
203
|
+
case "RuntimeVersionDeletedException":
|
|
204
|
+
raise capo_lambda.errors.runtime_version_deleted_exception.RuntimeVersionDeletedException.from_json(
|
|
205
|
+
data, message, response=response
|
|
206
|
+
)
|
|
197
207
|
case "S3FilesMountConnectivityException":
|
|
198
208
|
raise capo_lambda.errors.s3_files_mount_connectivity_exception.S3FilesMountConnectivityException.from_json(
|
|
199
209
|
data, message, response=response
|
|
@@ -40,6 +40,8 @@ import capo_lambda.errors.request_too_large_exception
|
|
|
40
40
|
import capo_lambda.errors.resource_conflict_exception
|
|
41
41
|
import capo_lambda.errors.resource_not_found_exception
|
|
42
42
|
import capo_lambda.errors.resource_not_ready_exception
|
|
43
|
+
import capo_lambda.errors.runtime_alias_deleted_exception
|
|
44
|
+
import capo_lambda.errors.runtime_version_deleted_exception
|
|
43
45
|
import capo_lambda.errors.s3_files_mount_connectivity_exception
|
|
44
46
|
import capo_lambda.errors.s3_files_mount_failure_exception
|
|
45
47
|
import capo_lambda.errors.s3_files_mount_timeout_exception
|
|
@@ -186,6 +188,14 @@ def handle_error(response: zapros.Response) -> Never:
|
|
|
186
188
|
raise capo_lambda.errors.resource_not_ready_exception.ResourceNotReadyException.from_json(
|
|
187
189
|
data, message, response=response
|
|
188
190
|
)
|
|
191
|
+
case "RuntimeAliasDeletedException":
|
|
192
|
+
raise capo_lambda.errors.runtime_alias_deleted_exception.RuntimeAliasDeletedException.from_json(
|
|
193
|
+
data, message, response=response
|
|
194
|
+
)
|
|
195
|
+
case "RuntimeVersionDeletedException":
|
|
196
|
+
raise capo_lambda.errors.runtime_version_deleted_exception.RuntimeVersionDeletedException.from_json(
|
|
197
|
+
data, message, response=response
|
|
198
|
+
)
|
|
189
199
|
case "S3FilesMountConnectivityException":
|
|
190
200
|
raise capo_lambda.errors.s3_files_mount_connectivity_exception.S3FilesMountConnectivityException.from_json(
|
|
191
201
|
data, message, response=response
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.lambda#PauseDurableExecution``."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from typing import Any
|
|
7
|
+
from urllib.parse import quote
|
|
8
|
+
|
|
9
|
+
import zapros
|
|
10
|
+
from typing_extensions import Never
|
|
11
|
+
|
|
12
|
+
import capo_lambda._auth._signers
|
|
13
|
+
import capo_lambda._auth._sigv4
|
|
14
|
+
import capo_lambda._protocol.eventstream
|
|
15
|
+
import capo_lambda.errors.invalid_parameter_value_exception
|
|
16
|
+
import capo_lambda.errors.kms_access_denied_exception
|
|
17
|
+
import capo_lambda.errors.kms_disabled_exception
|
|
18
|
+
import capo_lambda.errors.kms_invalid_state_exception
|
|
19
|
+
import capo_lambda.errors.kms_not_found_exception
|
|
20
|
+
import capo_lambda.errors.resource_conflict_exception
|
|
21
|
+
import capo_lambda.errors.resource_not_found_exception
|
|
22
|
+
import capo_lambda.errors.service_exception
|
|
23
|
+
import capo_lambda.errors.too_many_requests_exception
|
|
24
|
+
import capo_lambda.types.pause_durable_execution_request
|
|
25
|
+
import capo_lambda.types.pause_durable_execution_response
|
|
26
|
+
from capo_lambda._protocol.errors import parse_error_metadata_json
|
|
27
|
+
from capo_lambda._rule_engine._endpoint_rule_set import EndpointParams, resolve
|
|
28
|
+
from capo_lambda._services._pipeline import (
|
|
29
|
+
AsyncOperationOptions,
|
|
30
|
+
OperationOptions,
|
|
31
|
+
raise_error,
|
|
32
|
+
)
|
|
33
|
+
from capo_lambda.errors import UnknownServiceError
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def handle_error(response: zapros.Response) -> Never:
|
|
37
|
+
data = json.loads(response.read())
|
|
38
|
+
code, message = parse_error_metadata_json(response, data)
|
|
39
|
+
match code:
|
|
40
|
+
case "InvalidParameterValueException":
|
|
41
|
+
raise capo_lambda.errors.invalid_parameter_value_exception.InvalidParameterValueException.from_json(
|
|
42
|
+
data, message, response=response
|
|
43
|
+
)
|
|
44
|
+
case "KMSAccessDeniedException":
|
|
45
|
+
raise capo_lambda.errors.kms_access_denied_exception.KMSAccessDeniedException.from_json(
|
|
46
|
+
data, message, response=response
|
|
47
|
+
)
|
|
48
|
+
case "KMSDisabledException":
|
|
49
|
+
raise capo_lambda.errors.kms_disabled_exception.KMSDisabledException.from_json(
|
|
50
|
+
data, message, response=response
|
|
51
|
+
)
|
|
52
|
+
case "KMSInvalidStateException":
|
|
53
|
+
raise capo_lambda.errors.kms_invalid_state_exception.KMSInvalidStateException.from_json(
|
|
54
|
+
data, message, response=response
|
|
55
|
+
)
|
|
56
|
+
case "KMSNotFoundException":
|
|
57
|
+
raise capo_lambda.errors.kms_not_found_exception.KMSNotFoundException.from_json(
|
|
58
|
+
data, message, response=response
|
|
59
|
+
)
|
|
60
|
+
case "ResourceConflictException":
|
|
61
|
+
raise capo_lambda.errors.resource_conflict_exception.ResourceConflictException.from_json(
|
|
62
|
+
data, message, response=response
|
|
63
|
+
)
|
|
64
|
+
case "ResourceNotFoundException":
|
|
65
|
+
raise capo_lambda.errors.resource_not_found_exception.ResourceNotFoundException.from_json(
|
|
66
|
+
data, message, response=response
|
|
67
|
+
)
|
|
68
|
+
case "ServiceException":
|
|
69
|
+
raise capo_lambda.errors.service_exception.ServiceException.from_json(
|
|
70
|
+
data, message, response=response
|
|
71
|
+
)
|
|
72
|
+
case "TooManyRequestsException":
|
|
73
|
+
raise capo_lambda.errors.too_many_requests_exception.TooManyRequestsException.from_json(
|
|
74
|
+
data, message, response=response
|
|
75
|
+
)
|
|
76
|
+
case _:
|
|
77
|
+
raise UnknownServiceError(code=code, message=message, response=response)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def handle_response(
|
|
81
|
+
response: zapros.Response,
|
|
82
|
+
) -> capo_lambda.types.pause_durable_execution_response.PauseDurableExecutionResponse:
|
|
83
|
+
out: capo_lambda.types.pause_durable_execution_response.PauseDurableExecutionResponse = {} # type: ignore[typeddict-item]
|
|
84
|
+
return out
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
async def async_handle_response(
|
|
88
|
+
response: zapros.Response,
|
|
89
|
+
) -> capo_lambda.types.pause_durable_execution_response.PauseDurableExecutionResponse:
|
|
90
|
+
out: capo_lambda.types.pause_durable_execution_response.PauseDurableExecutionResponse = {} # type: ignore[typeddict-item]
|
|
91
|
+
return out
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def get_signer(
|
|
95
|
+
options: AsyncOperationOptions | OperationOptions,
|
|
96
|
+
auth_schemes: list[dict[str, Any]] | None = None,
|
|
97
|
+
) -> capo_lambda._auth._signers.Signer | None:
|
|
98
|
+
name_to_schema = {s["name"]: s for s in (auth_schemes or [])} # noqa: F841
|
|
99
|
+
if (
|
|
100
|
+
options.credentials_provider is not None
|
|
101
|
+
and name_to_schema
|
|
102
|
+
and not name_to_schema.keys() & {"sigv4", "sigv4-s3express"}
|
|
103
|
+
):
|
|
104
|
+
raise RuntimeError(
|
|
105
|
+
"Endpoint requires an unsupported auth scheme: " + ", ".join(name_to_schema)
|
|
106
|
+
)
|
|
107
|
+
if options.credentials_provider is not None:
|
|
108
|
+
endpoint_scheme = name_to_schema.get("sigv4") or name_to_schema.get(
|
|
109
|
+
"sigv4-s3express"
|
|
110
|
+
)
|
|
111
|
+
if endpoint_scheme is not None or not name_to_schema:
|
|
112
|
+
sigv4_config = capo_lambda._auth._sigv4.build_sigv4_auth_scheme(
|
|
113
|
+
"lambda", options.region, endpoint_scheme
|
|
114
|
+
)
|
|
115
|
+
if sigv4_config is not None:
|
|
116
|
+
return capo_lambda._auth._signers.SigV4Signer(
|
|
117
|
+
options.credentials_provider, auth_scheme=sigv4_config
|
|
118
|
+
)
|
|
119
|
+
raise RuntimeError("Auth was not resolved")
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def build_request(
|
|
123
|
+
options: OperationOptions | AsyncOperationOptions,
|
|
124
|
+
input_: capo_lambda.types.pause_durable_execution_request.PauseDurableExecutionRequest,
|
|
125
|
+
) -> zapros.Request:
|
|
126
|
+
endpoint = resolve(
|
|
127
|
+
EndpointParams(
|
|
128
|
+
Region=options.region,
|
|
129
|
+
UseDualStack=options.use_dual_stack,
|
|
130
|
+
UseFIPS=options.use_fips,
|
|
131
|
+
Endpoint=options.endpoint,
|
|
132
|
+
)
|
|
133
|
+
) # noqa: F841
|
|
134
|
+
url = (
|
|
135
|
+
endpoint.url.rstrip("/")
|
|
136
|
+
+ "/2025-12-01/durable-executions/{DurableExecutionArn}/pause"
|
|
137
|
+
)
|
|
138
|
+
url = url.replace(
|
|
139
|
+
"{DurableExecutionArn}", quote(input_["durable_execution_arn"], safe="")
|
|
140
|
+
)
|
|
141
|
+
params: list[tuple[str, str]] = []
|
|
142
|
+
headers: dict[str, str] = {k: ", ".join(v) for k, v in endpoint.headers.items()}
|
|
143
|
+
body: bytes | None = json.dumps(
|
|
144
|
+
capo_lambda.types.pause_durable_execution_request.serialize_json(input_),
|
|
145
|
+
allow_nan=False,
|
|
146
|
+
).encode()
|
|
147
|
+
headers["content-type"] = "application/json"
|
|
148
|
+
signer = (
|
|
149
|
+
None
|
|
150
|
+
if options.anonymous
|
|
151
|
+
else get_signer(options, auth_schemes=endpoint.properties.get("authSchemes"))
|
|
152
|
+
)
|
|
153
|
+
normalized_url = zapros.URL(url)
|
|
154
|
+
for k, v in params:
|
|
155
|
+
normalized_url.search_params.append(k, v)
|
|
156
|
+
return zapros.Request(
|
|
157
|
+
normalized_url, "POST", headers=headers, body=body, context={"signer": signer}
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
def pause_durable_execution(
|
|
162
|
+
options: OperationOptions,
|
|
163
|
+
input_: capo_lambda.types.pause_durable_execution_request.PauseDurableExecutionRequest,
|
|
164
|
+
) -> tuple[
|
|
165
|
+
capo_lambda.types.pause_durable_execution_response.PauseDurableExecutionResponse,
|
|
166
|
+
zapros.Response,
|
|
167
|
+
]:
|
|
168
|
+
response = options.client.handler.handle(build_request(options, input_))
|
|
169
|
+
try:
|
|
170
|
+
if response.status >= 300:
|
|
171
|
+
response.read()
|
|
172
|
+
raise_error(response, handle_error)
|
|
173
|
+
return handle_response(response), response
|
|
174
|
+
except BaseException:
|
|
175
|
+
response.close()
|
|
176
|
+
raise
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
async def async_pause_durable_execution(
|
|
180
|
+
options: AsyncOperationOptions,
|
|
181
|
+
input_: capo_lambda.types.pause_durable_execution_request.PauseDurableExecutionRequest,
|
|
182
|
+
) -> tuple[
|
|
183
|
+
capo_lambda.types.pause_durable_execution_response.PauseDurableExecutionResponse,
|
|
184
|
+
zapros.Response,
|
|
185
|
+
]:
|
|
186
|
+
response = await options.client.handler.ahandle(build_request(options, input_))
|
|
187
|
+
try:
|
|
188
|
+
if response.status >= 300:
|
|
189
|
+
await response.aread()
|
|
190
|
+
raise_error(response, handle_error)
|
|
191
|
+
return await async_handle_response(response), response
|
|
192
|
+
except BaseException:
|
|
193
|
+
await response.aclose()
|
|
194
|
+
raise
|
|
@@ -20,6 +20,7 @@ import capo_lambda.errors.resource_conflict_exception
|
|
|
20
20
|
import capo_lambda.errors.resource_not_found_exception
|
|
21
21
|
import capo_lambda.errors.service_exception
|
|
22
22
|
import capo_lambda.errors.too_many_requests_exception
|
|
23
|
+
import capo_lambda.types.accelerator_config
|
|
23
24
|
import capo_lambda.types.architectures_list
|
|
24
25
|
import capo_lambda.types.capacity_provider_config
|
|
25
26
|
import capo_lambda.types.dead_letter_config
|
|
@@ -28,6 +29,7 @@ import capo_lambda.types.environment_response
|
|
|
28
29
|
import capo_lambda.types.ephemeral_storage
|
|
29
30
|
import capo_lambda.types.file_system_config_list
|
|
30
31
|
import capo_lambda.types.function_configuration
|
|
32
|
+
import capo_lambda.types.function_runtime_config
|
|
31
33
|
import capo_lambda.types.function_version_latest_published
|
|
32
34
|
import capo_lambda.types.image_config_response
|
|
33
35
|
import capo_lambda.types.last_update_status
|
|
@@ -14,6 +14,7 @@ import capo_lambda._auth._sigv4
|
|
|
14
14
|
import capo_lambda._protocol.eventstream
|
|
15
15
|
import capo_lambda.errors.invalid_parameter_value_exception
|
|
16
16
|
import capo_lambda.errors.precondition_failed_exception
|
|
17
|
+
import capo_lambda.errors.resource_conflict_exception
|
|
17
18
|
import capo_lambda.errors.resource_not_found_exception
|
|
18
19
|
import capo_lambda.errors.service_exception
|
|
19
20
|
import capo_lambda.errors.too_many_requests_exception
|
|
@@ -40,6 +41,10 @@ def handle_error(response: zapros.Response) -> Never:
|
|
|
40
41
|
raise capo_lambda.errors.precondition_failed_exception.PreconditionFailedException.from_json(
|
|
41
42
|
data, message, response=response
|
|
42
43
|
)
|
|
44
|
+
case "ResourceConflictException":
|
|
45
|
+
raise capo_lambda.errors.resource_conflict_exception.ResourceConflictException.from_json(
|
|
46
|
+
data, message, response=response
|
|
47
|
+
)
|
|
43
48
|
case "ResourceNotFoundException":
|
|
44
49
|
raise capo_lambda.errors.resource_not_found_exception.ResourceNotFoundException.from_json(
|
|
45
50
|
data, message, response=response
|