capo-lambda-web 0.2.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.
Files changed (154) hide show
  1. capo_lambda_web/__init__.py +71 -0
  2. capo_lambda_web/_async.py +25 -0
  3. capo_lambda_web/_auth/_identity.py +16 -0
  4. capo_lambda_web/_auth/_providers.py +886 -0
  5. capo_lambda_web/_auth/_signers.py +121 -0
  6. capo_lambda_web/_auth/_sigv4.py +579 -0
  7. capo_lambda_web/_auth/_zapros_handler.py +80 -0
  8. capo_lambda_web/_body.py +221 -0
  9. capo_lambda_web/_iter.py +113 -0
  10. capo_lambda_web/_operations/lambda_web/create_web_function.py +184 -0
  11. capo_lambda_web/_operations/lambda_web/create_web_function_endpoint.py +194 -0
  12. capo_lambda_web/_operations/lambda_web/create_web_function_revision.py +188 -0
  13. capo_lambda_web/_operations/lambda_web/delete_resource_policy.py +147 -0
  14. capo_lambda_web/_operations/lambda_web/delete_web_function.py +145 -0
  15. capo_lambda_web/_operations/lambda_web/delete_web_function_endpoint.py +149 -0
  16. capo_lambda_web/_operations/lambda_web/delete_web_function_revision.py +149 -0
  17. capo_lambda_web/_operations/lambda_web/get_resource_policy.py +165 -0
  18. capo_lambda_web/_operations/lambda_web/get_web_account_settings.py +155 -0
  19. capo_lambda_web/_operations/lambda_web/get_web_function.py +171 -0
  20. capo_lambda_web/_operations/lambda_web/get_web_function_endpoint.py +180 -0
  21. capo_lambda_web/_operations/lambda_web/get_web_function_revision.py +174 -0
  22. capo_lambda_web/_operations/lambda_web/list_tags.py +164 -0
  23. capo_lambda_web/_operations/lambda_web/list_web_function_endpoints.py +176 -0
  24. capo_lambda_web/_operations/lambda_web/list_web_function_revisions.py +176 -0
  25. capo_lambda_web/_operations/lambda_web/list_web_functions.py +168 -0
  26. capo_lambda_web/_operations/lambda_web/put_resource_policy.py +179 -0
  27. capo_lambda_web/_operations/lambda_web/tag_resource.py +155 -0
  28. capo_lambda_web/_operations/lambda_web/untag_resource.py +148 -0
  29. capo_lambda_web/_operations/lambda_web/update_web_function_endpoint.py +196 -0
  30. capo_lambda_web/_pagination.py +21 -0
  31. capo_lambda_web/_protocol/__init__.py +1 -0
  32. capo_lambda_web/_protocol/errors.py +93 -0
  33. capo_lambda_web/_protocol/eventstream.py +240 -0
  34. capo_lambda_web/_protocol/serialize.py +47 -0
  35. capo_lambda_web/_protocol/xml.py +33 -0
  36. capo_lambda_web/_resources/lambda_web/web_function.py +477 -0
  37. capo_lambda_web/_rule_engine/__init__.py +0 -0
  38. capo_lambda_web/_rule_engine/_aws_partition.py +160 -0
  39. capo_lambda_web/_rule_engine/_endpoint_rule_set.py +135 -0
  40. capo_lambda_web/_rule_engine/_endpoint_runtime.py +389 -0
  41. capo_lambda_web/_services/_aws_config.py +160 -0
  42. capo_lambda_web/_services/_pipeline.py +264 -0
  43. capo_lambda_web/_services/async_lambda_web.py +1394 -0
  44. capo_lambda_web/_services/lambda_web.py +1374 -0
  45. capo_lambda_web/errors/__init__.py +36 -0
  46. capo_lambda_web/errors/_base.py +94 -0
  47. capo_lambda_web/errors/access_denied_exception.py +48 -0
  48. capo_lambda_web/errors/conflict_exception.py +58 -0
  49. capo_lambda_web/errors/internal_server_exception.py +47 -0
  50. capo_lambda_web/errors/resource_not_found_exception.py +60 -0
  51. capo_lambda_web/errors/service_quota_exceeded_exception.py +74 -0
  52. capo_lambda_web/errors/throttling_exception.py +60 -0
  53. capo_lambda_web/errors/validation_exception.py +46 -0
  54. capo_lambda_web/py.typed +0 -0
  55. capo_lambda_web/types/_prelude/blob.py +12 -0
  56. capo_lambda_web/types/_prelude/timestamp.py +17 -0
  57. capo_lambda_web/types/account_quotas.py +47 -0
  58. capo_lambda_web/types/account_usage.py +26 -0
  59. capo_lambda_web/types/application_log_level.py +22 -0
  60. capo_lambda_web/types/auth_type.py +18 -0
  61. capo_lambda_web/types/auto_deployment_mode.py +18 -0
  62. capo_lambda_web/types/build_config.py +55 -0
  63. capo_lambda_web/types/code_config.py +37 -0
  64. capo_lambda_web/types/create_web_function_endpoint_request.py +164 -0
  65. capo_lambda_web/types/create_web_function_endpoint_response.py +291 -0
  66. capo_lambda_web/types/create_web_function_request.py +72 -0
  67. capo_lambda_web/types/create_web_function_response.py +144 -0
  68. capo_lambda_web/types/create_web_function_revision_request.py +76 -0
  69. capo_lambda_web/types/create_web_function_revision_response.py +157 -0
  70. capo_lambda_web/types/date_time.py +20 -0
  71. capo_lambda_web/types/delete_resource_policy_request.py +29 -0
  72. capo_lambda_web/types/delete_web_function_endpoint_request.py +27 -0
  73. capo_lambda_web/types/delete_web_function_request.py +24 -0
  74. capo_lambda_web/types/delete_web_function_revision_request.py +27 -0
  75. capo_lambda_web/types/description.py +5 -0
  76. capo_lambda_web/types/domain_name.py +5 -0
  77. capo_lambda_web/types/endpoint_arn.py +5 -0
  78. capo_lambda_web/types/endpoint_config.py +134 -0
  79. capo_lambda_web/types/endpoint_name.py +5 -0
  80. capo_lambda_web/types/endpoint_state.py +20 -0
  81. capo_lambda_web/types/endpoint_type.py +19 -0
  82. capo_lambda_web/types/endpoint_update_status.py +19 -0
  83. capo_lambda_web/types/environment_variables.py +22 -0
  84. capo_lambda_web/types/filter.py +46 -0
  85. capo_lambda_web/types/filter_list.py +29 -0
  86. capo_lambda_web/types/filter_value_list.py +14 -0
  87. capo_lambda_web/types/function_arn.py +5 -0
  88. capo_lambda_web/types/function_endpoint_summary.py +249 -0
  89. capo_lambda_web/types/function_endpoint_summary_list.py +33 -0
  90. capo_lambda_web/types/function_name.py +5 -0
  91. capo_lambda_web/types/function_revision_summary.py +83 -0
  92. capo_lambda_web/types/function_revision_summary_list.py +33 -0
  93. capo_lambda_web/types/function_state.py +20 -0
  94. capo_lambda_web/types/function_summary.py +91 -0
  95. capo_lambda_web/types/function_summary_list.py +31 -0
  96. capo_lambda_web/types/get_resource_policy_request.py +24 -0
  97. capo_lambda_web/types/get_resource_policy_response.py +39 -0
  98. capo_lambda_web/types/get_web_account_settings_request.py +18 -0
  99. capo_lambda_web/types/get_web_account_settings_response.py +59 -0
  100. capo_lambda_web/types/get_web_function_endpoint_request.py +27 -0
  101. capo_lambda_web/types/get_web_function_endpoint_response.py +285 -0
  102. capo_lambda_web/types/get_web_function_request.py +24 -0
  103. capo_lambda_web/types/get_web_function_response.py +91 -0
  104. capo_lambda_web/types/get_web_function_revision_request.py +27 -0
  105. capo_lambda_web/types/get_web_function_revision_response.py +155 -0
  106. capo_lambda_web/types/kms_key_arn.py +5 -0
  107. capo_lambda_web/types/list_tags_request.py +24 -0
  108. capo_lambda_web/types/list_tags_response.py +32 -0
  109. capo_lambda_web/types/list_web_function_endpoints_request.py +54 -0
  110. capo_lambda_web/types/list_web_function_endpoints_response.py +52 -0
  111. capo_lambda_web/types/list_web_function_revisions_request.py +54 -0
  112. capo_lambda_web/types/list_web_function_revisions_response.py +52 -0
  113. capo_lambda_web/types/list_web_functions_request.py +51 -0
  114. capo_lambda_web/types/list_web_functions_response.py +46 -0
  115. capo_lambda_web/types/logging_config.py +67 -0
  116. capo_lambda_web/types/max_results.py +5 -0
  117. capo_lambda_web/types/next_token.py +5 -0
  118. capo_lambda_web/types/policy_revision_id.py +5 -0
  119. capo_lambda_web/types/put_resource_policy_request.py +43 -0
  120. capo_lambda_web/types/put_resource_policy_response.py +39 -0
  121. capo_lambda_web/types/region.py +5 -0
  122. capo_lambda_web/types/region_list.py +17 -0
  123. capo_lambda_web/types/regional_endpoint.py +140 -0
  124. capo_lambda_web/types/regional_endpoints.py +33 -0
  125. capo_lambda_web/types/resource_arn.py +5 -0
  126. capo_lambda_web/types/resource_policy.py +5 -0
  127. capo_lambda_web/types/revision_arn.py +5 -0
  128. capo_lambda_web/types/revision_config.py +69 -0
  129. capo_lambda_web/types/revision_error.py +40 -0
  130. capo_lambda_web/types/revision_errors.py +29 -0
  131. capo_lambda_web/types/revision_id.py +5 -0
  132. capo_lambda_web/types/revision_state.py +19 -0
  133. capo_lambda_web/types/revision_weight.py +38 -0
  134. capo_lambda_web/types/revision_weight_list.py +31 -0
  135. capo_lambda_web/types/role_arn.py +5 -0
  136. capo_lambda_web/types/runtime_config.py +26 -0
  137. capo_lambda_web/types/s3_object.py +39 -0
  138. capo_lambda_web/types/scaling_config.py +23 -0
  139. capo_lambda_web/types/service_config.py +87 -0
  140. capo_lambda_web/types/system_log_level.py +19 -0
  141. capo_lambda_web/types/tag_key.py +5 -0
  142. capo_lambda_web/types/tag_key_list.py +17 -0
  143. capo_lambda_web/types/tag_resource_request.py +38 -0
  144. capo_lambda_web/types/tags.py +25 -0
  145. capo_lambda_web/types/telemetry_config.py +36 -0
  146. capo_lambda_web/types/throttle_config.py +23 -0
  147. capo_lambda_web/types/untag_resource_request.py +27 -0
  148. capo_lambda_web/types/update_web_function_endpoint_request.py +121 -0
  149. capo_lambda_web/types/update_web_function_endpoint_response.py +291 -0
  150. capo_lambda_web-0.2.0.dist-info/METADATA +104 -0
  151. capo_lambda_web-0.2.0.dist-info/RECORD +154 -0
  152. capo_lambda_web-0.2.0.dist-info/WHEEL +5 -0
  153. capo_lambda_web-0.2.0.dist-info/licenses/LICENSE +21 -0
  154. capo_lambda_web-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,477 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Optional
4
+
5
+ import capo_lambda_web._auth._signers
6
+ import capo_lambda_web._auth._sigv4
7
+ from capo_lambda_web._services._pipeline import (
8
+ AsyncOperationRequest,
9
+ AsyncOperationResponse,
10
+ OperationRequest,
11
+ OperationResponse,
12
+ aexecute_pipeline,
13
+ execute_pipeline,
14
+ )
15
+
16
+ if TYPE_CHECKING:
17
+ import capo_lambda_web.types.create_web_function_request
18
+ import capo_lambda_web.types.create_web_function_response
19
+ import capo_lambda_web.types.delete_web_function_request
20
+ import capo_lambda_web.types.endpoint_config
21
+ import capo_lambda_web.types.filter_list
22
+ import capo_lambda_web.types.function_name
23
+ import capo_lambda_web.types.function_summary
24
+ import capo_lambda_web.types.get_web_function_request
25
+ import capo_lambda_web.types.get_web_function_response
26
+ import capo_lambda_web.types.list_web_functions_request
27
+ import capo_lambda_web.types.list_web_functions_response
28
+ import capo_lambda_web.types.max_results
29
+ import capo_lambda_web.types.next_token
30
+ import capo_lambda_web.types.revision_config
31
+ import capo_lambda_web.types.tags
32
+ from capo_lambda_web._services.async_lambda_web import (
33
+ AsyncLambdaWebClient,
34
+ AsyncLambdaWebClientConfig,
35
+ )
36
+ from capo_lambda_web._services.lambda_web import (
37
+ LambdaWebClient,
38
+ LambdaWebClientConfig,
39
+ )
40
+
41
+
42
+ class WebFunction:
43
+ def __init__(self, service: LambdaWebClient) -> None:
44
+ self._service = service
45
+
46
+ def put(
47
+ self,
48
+ function_name: "capo_lambda_web.types.function_name.FunctionName",
49
+ *,
50
+ config_overrides: Optional[LambdaWebClientConfig] = None,
51
+ revision_config: Optional[
52
+ "capo_lambda_web.types.revision_config.RevisionConfig"
53
+ ] = None,
54
+ endpoint_config: Optional[
55
+ "capo_lambda_web.types.endpoint_config.EndpointConfig"
56
+ ] = None,
57
+ tags: Optional["capo_lambda_web.types.tags.Tags"] = None,
58
+ ) -> "capo_lambda_web.types.create_web_function_response.CreateWebFunctionResponse":
59
+ """<p>Creates a web function with an initial revision and endpoint. To create a web function, you provide the function name, revision configuration (code and service settings), and endpoint configuration.</p> <p>To use this operation, you must have the <code>CreateWebFunction</code> permission on the web function. You don't need separate permissions for the initial revision or endpoint.</p> <note> <p>This API is experimental and for internal AWS use only. It is not yet available to external customers.</p> </note>
60
+
61
+ Args:
62
+ function_name: <p>The name of the web function. The name can contain letters, numbers, hyphens (-), and underscores (_), and can't begin or end with a hyphen or an underscore. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
63
+ revision_config: <p>The configuration for the initial revision of the web function, including code and service settings.</p>
64
+ endpoint_config: <p>The configuration for the initial endpoint of the web function.</p>
65
+ tags: <p>A map of tag keys and values to apply to the web function.</p>
66
+
67
+ Raises:
68
+ capo_lambda_web.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this operation.</p>
69
+ capo_lambda_web.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource. Resolve the conflict and try again.</p>
70
+ capo_lambda_web.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Try again later.</p>
71
+ capo_lambda_web.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify the resource identifier and try again.</p>
72
+ capo_lambda_web.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>A service quota was exceeded. Request a quota increase or reduce usage and try again.</p>
73
+ capo_lambda_web.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Reduce the frequency of requests and try again.</p>
74
+ capo_lambda_web.errors.validation_exception.ValidationException: <p>The request failed validation. Check the request parameters and try again.</p>
75
+ capo_lambda_web.errors.UnknownServiceError: The service returned an error code this client does not model.
76
+ """
77
+
78
+ def _handler(
79
+ req: "OperationRequest[capo_lambda_web.types.create_web_function_request.CreateWebFunctionRequest]",
80
+ ) -> OperationResponse[
81
+ "capo_lambda_web.types.create_web_function_response.CreateWebFunctionResponse"
82
+ ]:
83
+ import capo_lambda_web._operations.lambda_web.create_web_function
84
+
85
+ output, http_response = (
86
+ capo_lambda_web._operations.lambda_web.create_web_function.create_web_function(
87
+ req.options, req.input
88
+ )
89
+ )
90
+ return OperationResponse(output=output, response=http_response)
91
+
92
+ interceptors_, options_ = self._service.operation_options(config_overrides)
93
+ input_: capo_lambda_web.types.create_web_function_request.CreateWebFunctionRequest = {
94
+ "function_name": function_name
95
+ }
96
+ if revision_config is not None:
97
+ input_["revision_config"] = revision_config
98
+ if endpoint_config is not None:
99
+ input_["endpoint_config"] = endpoint_config
100
+ if tags is not None:
101
+ input_["tags"] = tags
102
+
103
+ response = execute_pipeline(
104
+ OperationRequest(input=input_, options=options_),
105
+ handler=_handler,
106
+ interceptors=list(interceptors_),
107
+ )
108
+ response.response.close()
109
+ return response.output
110
+
111
+ def read(
112
+ self,
113
+ function_name: "capo_lambda_web.types.function_name.FunctionName",
114
+ *,
115
+ config_overrides: Optional[LambdaWebClientConfig] = None,
116
+ ) -> "capo_lambda_web.types.get_web_function_response.GetWebFunctionResponse":
117
+ """<p>Retrieves details about a web function, including its current state and configuration.</p> <note> <p>This API is experimental and for internal AWS use only. It is not yet available to external customers.</p> </note>
118
+
119
+ Args:
120
+ function_name: <p>The name of the web function to retrieve. You can specify the function name or the function ARN. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
121
+
122
+ Raises:
123
+ capo_lambda_web.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this operation.</p>
124
+ capo_lambda_web.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Try again later.</p>
125
+ capo_lambda_web.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify the resource identifier and try again.</p>
126
+ capo_lambda_web.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Reduce the frequency of requests and try again.</p>
127
+ capo_lambda_web.errors.validation_exception.ValidationException: <p>The request failed validation. Check the request parameters and try again.</p>
128
+ capo_lambda_web.errors.UnknownServiceError: The service returned an error code this client does not model.
129
+ """
130
+
131
+ def _handler(
132
+ req: "OperationRequest[capo_lambda_web.types.get_web_function_request.GetWebFunctionRequest]",
133
+ ) -> OperationResponse[
134
+ "capo_lambda_web.types.get_web_function_response.GetWebFunctionResponse"
135
+ ]:
136
+ import capo_lambda_web._operations.lambda_web.get_web_function
137
+
138
+ output, http_response = (
139
+ capo_lambda_web._operations.lambda_web.get_web_function.get_web_function(
140
+ req.options, req.input
141
+ )
142
+ )
143
+ return OperationResponse(output=output, response=http_response)
144
+
145
+ interceptors_, options_ = self._service.operation_options(config_overrides)
146
+ input_: capo_lambda_web.types.get_web_function_request.GetWebFunctionRequest = {
147
+ "function_name": function_name
148
+ }
149
+
150
+ response = execute_pipeline(
151
+ OperationRequest(input=input_, options=options_),
152
+ handler=_handler,
153
+ interceptors=list(interceptors_),
154
+ )
155
+ response.response.close()
156
+ return response.output
157
+
158
+ def delete(
159
+ self,
160
+ function_name: "capo_lambda_web.types.function_name.FunctionName",
161
+ *,
162
+ config_overrides: Optional[LambdaWebClientConfig] = None,
163
+ ) -> None:
164
+ """<p>Deletes a web function and all of its associated revisions and endpoints.</p> <p>To use this operation, you must have the <code>DeleteWebFunction</code> permission on the web function. You don't need the <code>DeleteWebFunctionRevision</code> or <code>DeleteWebFunctionEndpoint</code> permission.</p> <note> <p>This API is experimental and for internal AWS use only. It is not yet available to external customers.</p> </note>
165
+
166
+ Args:
167
+ function_name: <p>The name of the web function to delete. You can specify the function name or the function ARN. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
168
+
169
+ Raises:
170
+ capo_lambda_web.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this operation.</p>
171
+ capo_lambda_web.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource. Resolve the conflict and try again.</p>
172
+ capo_lambda_web.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Try again later.</p>
173
+ capo_lambda_web.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify the resource identifier and try again.</p>
174
+ capo_lambda_web.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Reduce the frequency of requests and try again.</p>
175
+ capo_lambda_web.errors.validation_exception.ValidationException: <p>The request failed validation. Check the request parameters and try again.</p>
176
+ capo_lambda_web.errors.UnknownServiceError: The service returned an error code this client does not model.
177
+ """
178
+
179
+ def _handler(
180
+ req: "OperationRequest[capo_lambda_web.types.delete_web_function_request.DeleteWebFunctionRequest]",
181
+ ) -> OperationResponse[None]:
182
+ import capo_lambda_web._operations.lambda_web.delete_web_function
183
+
184
+ output, http_response = (
185
+ capo_lambda_web._operations.lambda_web.delete_web_function.delete_web_function(
186
+ req.options, req.input
187
+ )
188
+ )
189
+ return OperationResponse(output=output, response=http_response)
190
+
191
+ interceptors_, options_ = self._service.operation_options(config_overrides)
192
+ input_: capo_lambda_web.types.delete_web_function_request.DeleteWebFunctionRequest = {
193
+ "function_name": function_name
194
+ }
195
+
196
+ response = execute_pipeline(
197
+ OperationRequest(input=input_, options=options_),
198
+ handler=_handler,
199
+ interceptors=list(interceptors_),
200
+ )
201
+ response.response.close()
202
+ return response.output
203
+
204
+ def list(
205
+ self,
206
+ *,
207
+ config_overrides: Optional[LambdaWebClientConfig] = None,
208
+ filters: Optional["capo_lambda_web.types.filter_list.FilterList"] = None,
209
+ max_results: Optional["capo_lambda_web.types.max_results.MaxResults"] = None,
210
+ next_token: Optional["capo_lambda_web.types.next_token.NextToken"] = None,
211
+ ) -> "capo_lambda_web.types.list_web_functions_response.ListWebFunctionsResponse":
212
+ """<p>Lists web functions in your account. We recommend using pagination to ensure that the operation returns quickly and successfully.</p> <note> <p>This API is experimental and for internal AWS use only. It is not yet available to external customers.</p> </note>
213
+
214
+ Args:
215
+ filters: <p>A list of filters to apply to the results. The only supported filter name is <code>state</code>.</p>
216
+ max_results: <p>The maximum number of results to return in a single call. Minimum value of 1, maximum value of 50. Default is 50.</p>
217
+ next_token: <p>The pagination token that's returned by a previous request to retrieve the next page of results.</p>
218
+
219
+ Raises:
220
+ capo_lambda_web.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this operation.</p>
221
+ capo_lambda_web.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Try again later.</p>
222
+ capo_lambda_web.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Reduce the frequency of requests and try again.</p>
223
+ capo_lambda_web.errors.validation_exception.ValidationException: <p>The request failed validation. Check the request parameters and try again.</p>
224
+ capo_lambda_web.errors.UnknownServiceError: The service returned an error code this client does not model.
225
+ """
226
+
227
+ def _handler(
228
+ req: "OperationRequest[capo_lambda_web.types.list_web_functions_request.ListWebFunctionsRequest]",
229
+ ) -> OperationResponse[
230
+ "capo_lambda_web.types.list_web_functions_response.ListWebFunctionsResponse"
231
+ ]:
232
+ import capo_lambda_web._operations.lambda_web.list_web_functions
233
+
234
+ output, http_response = (
235
+ capo_lambda_web._operations.lambda_web.list_web_functions.list_web_functions(
236
+ req.options, req.input
237
+ )
238
+ )
239
+ return OperationResponse(output=output, response=http_response)
240
+
241
+ interceptors_, options_ = self._service.operation_options(config_overrides)
242
+ input_: capo_lambda_web.types.list_web_functions_request.ListWebFunctionsRequest = {}
243
+ if filters is not None:
244
+ input_["filters"] = filters
245
+ if max_results is not None:
246
+ input_["max_results"] = max_results
247
+ if next_token is not None:
248
+ input_["next_token"] = next_token
249
+
250
+ response = execute_pipeline(
251
+ OperationRequest(input=input_, options=options_),
252
+ handler=_handler,
253
+ interceptors=list(interceptors_),
254
+ )
255
+ response.response.close()
256
+ return response.output
257
+
258
+
259
+ class AsyncWebFunction:
260
+ def __init__(self, service: AsyncLambdaWebClient) -> None:
261
+ self._service = service
262
+
263
+ async def put(
264
+ self,
265
+ function_name: "capo_lambda_web.types.function_name.FunctionName",
266
+ *,
267
+ config_overrides: Optional[AsyncLambdaWebClientConfig] = None,
268
+ revision_config: Optional[
269
+ "capo_lambda_web.types.revision_config.RevisionConfig"
270
+ ] = None,
271
+ endpoint_config: Optional[
272
+ "capo_lambda_web.types.endpoint_config.EndpointConfig"
273
+ ] = None,
274
+ tags: Optional["capo_lambda_web.types.tags.Tags"] = None,
275
+ ) -> "capo_lambda_web.types.create_web_function_response.CreateWebFunctionResponse":
276
+ """<p>Creates a web function with an initial revision and endpoint. To create a web function, you provide the function name, revision configuration (code and service settings), and endpoint configuration.</p> <p>To use this operation, you must have the <code>CreateWebFunction</code> permission on the web function. You don't need separate permissions for the initial revision or endpoint.</p> <note> <p>This API is experimental and for internal AWS use only. It is not yet available to external customers.</p> </note>
277
+
278
+ Args:
279
+ function_name: <p>The name of the web function. The name can contain letters, numbers, hyphens (-), and underscores (_), and can't begin or end with a hyphen or an underscore. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
280
+ revision_config: <p>The configuration for the initial revision of the web function, including code and service settings.</p>
281
+ endpoint_config: <p>The configuration for the initial endpoint of the web function.</p>
282
+ tags: <p>A map of tag keys and values to apply to the web function.</p>
283
+
284
+ Raises:
285
+ capo_lambda_web.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this operation.</p>
286
+ capo_lambda_web.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource. Resolve the conflict and try again.</p>
287
+ capo_lambda_web.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Try again later.</p>
288
+ capo_lambda_web.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify the resource identifier and try again.</p>
289
+ capo_lambda_web.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>A service quota was exceeded. Request a quota increase or reduce usage and try again.</p>
290
+ capo_lambda_web.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Reduce the frequency of requests and try again.</p>
291
+ capo_lambda_web.errors.validation_exception.ValidationException: <p>The request failed validation. Check the request parameters and try again.</p>
292
+ capo_lambda_web.errors.UnknownServiceError: The service returned an error code this client does not model.
293
+ """
294
+
295
+ async def _handler(
296
+ req: "AsyncOperationRequest[capo_lambda_web.types.create_web_function_request.CreateWebFunctionRequest]",
297
+ ) -> AsyncOperationResponse[
298
+ "capo_lambda_web.types.create_web_function_response.CreateWebFunctionResponse"
299
+ ]:
300
+ import capo_lambda_web._operations.lambda_web.create_web_function
301
+
302
+ (
303
+ output,
304
+ http_response,
305
+ ) = await capo_lambda_web._operations.lambda_web.create_web_function.async_create_web_function(
306
+ req.options, req.input
307
+ )
308
+ return AsyncOperationResponse(output=output, response=http_response)
309
+
310
+ interceptors_, options_ = self._service.operation_options(config_overrides)
311
+ input_: capo_lambda_web.types.create_web_function_request.CreateWebFunctionRequest = {
312
+ "function_name": function_name
313
+ }
314
+ if revision_config is not None:
315
+ input_["revision_config"] = revision_config
316
+ if endpoint_config is not None:
317
+ input_["endpoint_config"] = endpoint_config
318
+ if tags is not None:
319
+ input_["tags"] = tags
320
+
321
+ response = await aexecute_pipeline(
322
+ AsyncOperationRequest(input=input_, options=options_),
323
+ handler=_handler,
324
+ interceptors=list(interceptors_),
325
+ )
326
+ await response.response.aclose()
327
+ return response.output
328
+
329
+ async def read(
330
+ self,
331
+ function_name: "capo_lambda_web.types.function_name.FunctionName",
332
+ *,
333
+ config_overrides: Optional[AsyncLambdaWebClientConfig] = None,
334
+ ) -> "capo_lambda_web.types.get_web_function_response.GetWebFunctionResponse":
335
+ """<p>Retrieves details about a web function, including its current state and configuration.</p> <note> <p>This API is experimental and for internal AWS use only. It is not yet available to external customers.</p> </note>
336
+
337
+ Args:
338
+ function_name: <p>The name of the web function to retrieve. You can specify the function name or the function ARN. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
339
+
340
+ Raises:
341
+ capo_lambda_web.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this operation.</p>
342
+ capo_lambda_web.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Try again later.</p>
343
+ capo_lambda_web.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify the resource identifier and try again.</p>
344
+ capo_lambda_web.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Reduce the frequency of requests and try again.</p>
345
+ capo_lambda_web.errors.validation_exception.ValidationException: <p>The request failed validation. Check the request parameters and try again.</p>
346
+ capo_lambda_web.errors.UnknownServiceError: The service returned an error code this client does not model.
347
+ """
348
+
349
+ async def _handler(
350
+ req: "AsyncOperationRequest[capo_lambda_web.types.get_web_function_request.GetWebFunctionRequest]",
351
+ ) -> AsyncOperationResponse[
352
+ "capo_lambda_web.types.get_web_function_response.GetWebFunctionResponse"
353
+ ]:
354
+ import capo_lambda_web._operations.lambda_web.get_web_function
355
+
356
+ (
357
+ output,
358
+ http_response,
359
+ ) = await capo_lambda_web._operations.lambda_web.get_web_function.async_get_web_function(
360
+ req.options, req.input
361
+ )
362
+ return AsyncOperationResponse(output=output, response=http_response)
363
+
364
+ interceptors_, options_ = self._service.operation_options(config_overrides)
365
+ input_: capo_lambda_web.types.get_web_function_request.GetWebFunctionRequest = {
366
+ "function_name": function_name
367
+ }
368
+
369
+ response = await aexecute_pipeline(
370
+ AsyncOperationRequest(input=input_, options=options_),
371
+ handler=_handler,
372
+ interceptors=list(interceptors_),
373
+ )
374
+ await response.response.aclose()
375
+ return response.output
376
+
377
+ async def delete(
378
+ self,
379
+ function_name: "capo_lambda_web.types.function_name.FunctionName",
380
+ *,
381
+ config_overrides: Optional[AsyncLambdaWebClientConfig] = None,
382
+ ) -> None:
383
+ """<p>Deletes a web function and all of its associated revisions and endpoints.</p> <p>To use this operation, you must have the <code>DeleteWebFunction</code> permission on the web function. You don't need the <code>DeleteWebFunctionRevision</code> or <code>DeleteWebFunctionEndpoint</code> permission.</p> <note> <p>This API is experimental and for internal AWS use only. It is not yet available to external customers.</p> </note>
384
+
385
+ Args:
386
+ function_name: <p>The name of the web function to delete. You can specify the function name or the function ARN. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
387
+
388
+ Raises:
389
+ capo_lambda_web.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this operation.</p>
390
+ capo_lambda_web.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource. Resolve the conflict and try again.</p>
391
+ capo_lambda_web.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Try again later.</p>
392
+ capo_lambda_web.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify the resource identifier and try again.</p>
393
+ capo_lambda_web.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Reduce the frequency of requests and try again.</p>
394
+ capo_lambda_web.errors.validation_exception.ValidationException: <p>The request failed validation. Check the request parameters and try again.</p>
395
+ capo_lambda_web.errors.UnknownServiceError: The service returned an error code this client does not model.
396
+ """
397
+
398
+ async def _handler(
399
+ req: "AsyncOperationRequest[capo_lambda_web.types.delete_web_function_request.DeleteWebFunctionRequest]",
400
+ ) -> AsyncOperationResponse[None]:
401
+ import capo_lambda_web._operations.lambda_web.delete_web_function
402
+
403
+ (
404
+ output,
405
+ http_response,
406
+ ) = await capo_lambda_web._operations.lambda_web.delete_web_function.async_delete_web_function(
407
+ req.options, req.input
408
+ )
409
+ return AsyncOperationResponse(output=output, response=http_response)
410
+
411
+ interceptors_, options_ = self._service.operation_options(config_overrides)
412
+ input_: capo_lambda_web.types.delete_web_function_request.DeleteWebFunctionRequest = {
413
+ "function_name": function_name
414
+ }
415
+
416
+ response = await aexecute_pipeline(
417
+ AsyncOperationRequest(input=input_, options=options_),
418
+ handler=_handler,
419
+ interceptors=list(interceptors_),
420
+ )
421
+ await response.response.aclose()
422
+ return response.output
423
+
424
+ async def list(
425
+ self,
426
+ *,
427
+ config_overrides: Optional[AsyncLambdaWebClientConfig] = None,
428
+ filters: Optional["capo_lambda_web.types.filter_list.FilterList"] = None,
429
+ max_results: Optional["capo_lambda_web.types.max_results.MaxResults"] = None,
430
+ next_token: Optional["capo_lambda_web.types.next_token.NextToken"] = None,
431
+ ) -> "capo_lambda_web.types.list_web_functions_response.ListWebFunctionsResponse":
432
+ """<p>Lists web functions in your account. We recommend using pagination to ensure that the operation returns quickly and successfully.</p> <note> <p>This API is experimental and for internal AWS use only. It is not yet available to external customers.</p> </note>
433
+
434
+ Args:
435
+ filters: <p>A list of filters to apply to the results. The only supported filter name is <code>state</code>.</p>
436
+ max_results: <p>The maximum number of results to return in a single call. Minimum value of 1, maximum value of 50. Default is 50.</p>
437
+ next_token: <p>The pagination token that's returned by a previous request to retrieve the next page of results.</p>
438
+
439
+ Raises:
440
+ capo_lambda_web.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this operation.</p>
441
+ capo_lambda_web.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Try again later.</p>
442
+ capo_lambda_web.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Reduce the frequency of requests and try again.</p>
443
+ capo_lambda_web.errors.validation_exception.ValidationException: <p>The request failed validation. Check the request parameters and try again.</p>
444
+ capo_lambda_web.errors.UnknownServiceError: The service returned an error code this client does not model.
445
+ """
446
+
447
+ async def _handler(
448
+ req: "AsyncOperationRequest[capo_lambda_web.types.list_web_functions_request.ListWebFunctionsRequest]",
449
+ ) -> AsyncOperationResponse[
450
+ "capo_lambda_web.types.list_web_functions_response.ListWebFunctionsResponse"
451
+ ]:
452
+ import capo_lambda_web._operations.lambda_web.list_web_functions
453
+
454
+ (
455
+ output,
456
+ http_response,
457
+ ) = await capo_lambda_web._operations.lambda_web.list_web_functions.async_list_web_functions(
458
+ req.options, req.input
459
+ )
460
+ return AsyncOperationResponse(output=output, response=http_response)
461
+
462
+ interceptors_, options_ = self._service.operation_options(config_overrides)
463
+ input_: capo_lambda_web.types.list_web_functions_request.ListWebFunctionsRequest = {}
464
+ if filters is not None:
465
+ input_["filters"] = filters
466
+ if max_results is not None:
467
+ input_["max_results"] = max_results
468
+ if next_token is not None:
469
+ input_["next_token"] = next_token
470
+
471
+ response = await aexecute_pipeline(
472
+ AsyncOperationRequest(input=input_, options=options_),
473
+ handler=_handler,
474
+ interceptors=list(interceptors_),
475
+ )
476
+ await response.response.aclose()
477
+ return response.output
File without changes
@@ -0,0 +1,160 @@
1
+ """AWS partitions table and ``aws.partition`` rules-engine function.
2
+
3
+ Data sourced from AWS SDK ``partitions.json``. All dispatch tables are
4
+ materialised at codegen time:
5
+
6
+ * ``_REGION_LOOKUP`` — O(1) dict of explicit region name -> partition outputs.
7
+ * ``_REGEX_LOOKUP`` — compiled-regex / outputs pairs for unknown regions.
8
+ * ``_DEFAULT_OUTPUTS`` — fallback partition (``aws``)."""
9
+
10
+ from __future__ import annotations
11
+
12
+ import re
13
+ from typing import Any
14
+
15
+ _PARTITION_AWS: dict[str, Any] = {
16
+ "dnsSuffix": "amazonaws.com",
17
+ "dualStackDnsSuffix": "api.aws",
18
+ "implicitGlobalRegion": "us-east-1",
19
+ "name": "aws",
20
+ "supportsDualStack": True,
21
+ "supportsFIPS": True,
22
+ }
23
+ _PARTITION_AWS_CN: dict[str, Any] = {
24
+ "dnsSuffix": "amazonaws.com.cn",
25
+ "dualStackDnsSuffix": "api.amazonwebservices.com.cn",
26
+ "implicitGlobalRegion": "cn-northwest-1",
27
+ "name": "aws-cn",
28
+ "supportsDualStack": True,
29
+ "supportsFIPS": True,
30
+ }
31
+ _PARTITION_AWS_EUSC: dict[str, Any] = {
32
+ "dnsSuffix": "amazonaws.eu",
33
+ "dualStackDnsSuffix": "api.amazonwebservices.eu",
34
+ "implicitGlobalRegion": "eusc-de-east-1",
35
+ "name": "aws-eusc",
36
+ "supportsDualStack": True,
37
+ "supportsFIPS": True,
38
+ }
39
+ _PARTITION_AWS_ISO: dict[str, Any] = {
40
+ "dnsSuffix": "c2s.ic.gov",
41
+ "dualStackDnsSuffix": "api.aws.ic.gov",
42
+ "implicitGlobalRegion": "us-iso-east-1",
43
+ "name": "aws-iso",
44
+ "supportsDualStack": True,
45
+ "supportsFIPS": True,
46
+ }
47
+ _PARTITION_AWS_ISO_B: dict[str, Any] = {
48
+ "dnsSuffix": "sc2s.sgov.gov",
49
+ "dualStackDnsSuffix": "api.aws.scloud",
50
+ "implicitGlobalRegion": "us-isob-east-1",
51
+ "name": "aws-iso-b",
52
+ "supportsDualStack": True,
53
+ "supportsFIPS": True,
54
+ }
55
+ _PARTITION_AWS_ISO_E: dict[str, Any] = {
56
+ "dnsSuffix": "cloud.adc-e.uk",
57
+ "dualStackDnsSuffix": "api.cloud-aws.adc-e.uk",
58
+ "implicitGlobalRegion": "eu-isoe-west-1",
59
+ "name": "aws-iso-e",
60
+ "supportsDualStack": True,
61
+ "supportsFIPS": True,
62
+ }
63
+ _PARTITION_AWS_ISO_F: dict[str, Any] = {
64
+ "dnsSuffix": "csp.hci.ic.gov",
65
+ "dualStackDnsSuffix": "api.aws.hci.ic.gov",
66
+ "implicitGlobalRegion": "us-isof-south-1",
67
+ "name": "aws-iso-f",
68
+ "supportsDualStack": True,
69
+ "supportsFIPS": True,
70
+ }
71
+ _PARTITION_AWS_US_GOV: dict[str, Any] = {
72
+ "dnsSuffix": "amazonaws.com",
73
+ "dualStackDnsSuffix": "api.aws",
74
+ "implicitGlobalRegion": "us-gov-west-1",
75
+ "name": "aws-us-gov",
76
+ "supportsDualStack": True,
77
+ "supportsFIPS": True,
78
+ }
79
+
80
+ _REGION_LOOKUP: dict[str, dict[str, Any]] = {
81
+ "af-south-1": _PARTITION_AWS,
82
+ "ap-east-1": _PARTITION_AWS,
83
+ "ap-east-2": _PARTITION_AWS,
84
+ "ap-northeast-1": _PARTITION_AWS,
85
+ "ap-northeast-2": _PARTITION_AWS,
86
+ "ap-northeast-3": _PARTITION_AWS,
87
+ "ap-south-1": _PARTITION_AWS,
88
+ "ap-south-2": _PARTITION_AWS,
89
+ "ap-southeast-1": _PARTITION_AWS,
90
+ "ap-southeast-2": _PARTITION_AWS,
91
+ "ap-southeast-3": _PARTITION_AWS,
92
+ "ap-southeast-4": _PARTITION_AWS,
93
+ "ap-southeast-5": _PARTITION_AWS,
94
+ "ap-southeast-6": _PARTITION_AWS,
95
+ "ap-southeast-7": _PARTITION_AWS,
96
+ "aws-global": _PARTITION_AWS,
97
+ "ca-central-1": _PARTITION_AWS,
98
+ "ca-west-1": _PARTITION_AWS,
99
+ "eu-central-1": _PARTITION_AWS,
100
+ "eu-central-2": _PARTITION_AWS,
101
+ "eu-north-1": _PARTITION_AWS,
102
+ "eu-south-1": _PARTITION_AWS,
103
+ "eu-south-2": _PARTITION_AWS,
104
+ "eu-west-1": _PARTITION_AWS,
105
+ "eu-west-2": _PARTITION_AWS,
106
+ "eu-west-3": _PARTITION_AWS,
107
+ "il-central-1": _PARTITION_AWS,
108
+ "me-central-1": _PARTITION_AWS,
109
+ "me-south-1": _PARTITION_AWS,
110
+ "mx-central-1": _PARTITION_AWS,
111
+ "sa-east-1": _PARTITION_AWS,
112
+ "us-east-1": _PARTITION_AWS,
113
+ "us-east-2": _PARTITION_AWS,
114
+ "us-west-1": _PARTITION_AWS,
115
+ "us-west-2": _PARTITION_AWS,
116
+ "aws-cn-global": _PARTITION_AWS_CN,
117
+ "cn-north-1": _PARTITION_AWS_CN,
118
+ "cn-northwest-1": _PARTITION_AWS_CN,
119
+ "eusc-de-east-1": _PARTITION_AWS_EUSC,
120
+ "aws-iso-global": _PARTITION_AWS_ISO,
121
+ "us-iso-east-1": _PARTITION_AWS_ISO,
122
+ "us-iso-west-1": _PARTITION_AWS_ISO,
123
+ "aws-iso-b-global": _PARTITION_AWS_ISO_B,
124
+ "us-isob-east-1": _PARTITION_AWS_ISO_B,
125
+ "us-isob-west-1": _PARTITION_AWS_ISO_B,
126
+ "aws-iso-e-global": _PARTITION_AWS_ISO_E,
127
+ "eu-isoe-west-1": _PARTITION_AWS_ISO_E,
128
+ "aws-iso-f-global": _PARTITION_AWS_ISO_F,
129
+ "us-isof-east-1": _PARTITION_AWS_ISO_F,
130
+ "us-isof-south-1": _PARTITION_AWS_ISO_F,
131
+ "aws-us-gov-global": _PARTITION_AWS_US_GOV,
132
+ "us-gov-east-1": _PARTITION_AWS_US_GOV,
133
+ "us-gov-west-1": _PARTITION_AWS_US_GOV,
134
+ }
135
+
136
+ _REGEX_LOOKUP: tuple[tuple[re.Pattern[str], dict[str, Any]], ...] = (
137
+ (re.compile(r"^(us|eu|ap|sa|ca|me|af|il|mx)\-\w+\-\d+$"), _PARTITION_AWS),
138
+ (re.compile(r"^cn\-\w+\-\d+$"), _PARTITION_AWS_CN),
139
+ (re.compile(r"^eusc\-(de)\-\w+\-\d+$"), _PARTITION_AWS_EUSC),
140
+ (re.compile(r"^us\-iso\-\w+\-\d+$"), _PARTITION_AWS_ISO),
141
+ (re.compile(r"^us\-isob\-\w+\-\d+$"), _PARTITION_AWS_ISO_B),
142
+ (re.compile(r"^eu\-isoe\-\w+\-\d+$"), _PARTITION_AWS_ISO_E),
143
+ (re.compile(r"^us\-isof\-\w+\-\d+$"), _PARTITION_AWS_ISO_F),
144
+ (re.compile(r"^us\-gov\-\w+\-\d+$"), _PARTITION_AWS_US_GOV),
145
+ )
146
+
147
+ _DEFAULT_OUTPUTS: dict[str, Any] = _PARTITION_AWS
148
+
149
+
150
+ def aws_partition(region: Any) -> dict[str, Any] | None:
151
+ """Resolve ``region`` to a partition outputs dict."""
152
+ if not isinstance(region, str):
153
+ return None
154
+ outputs = _REGION_LOOKUP.get(region)
155
+ if outputs is not None:
156
+ return outputs
157
+ for pattern, outputs in _REGEX_LOOKUP:
158
+ if pattern.fullmatch(region):
159
+ return outputs
160
+ return _DEFAULT_OUTPUTS