capo-cloudcontrol 0.1.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 (107) hide show
  1. capo_cloudcontrol/__init__.py +72 -0
  2. capo_cloudcontrol/_async.py +25 -0
  3. capo_cloudcontrol/_auth/_identity.py +16 -0
  4. capo_cloudcontrol/_auth/_providers.py +886 -0
  5. capo_cloudcontrol/_auth/_signers.py +88 -0
  6. capo_cloudcontrol/_auth/_sigv4.py +434 -0
  7. capo_cloudcontrol/_auth/_zapros_handler.py +80 -0
  8. capo_cloudcontrol/_iter.py +113 -0
  9. capo_cloudcontrol/_operations/cloud_api_service/cancel_resource_request.py +155 -0
  10. capo_cloudcontrol/_operations/cloud_api_service/create_resource.py +240 -0
  11. capo_cloudcontrol/_operations/cloud_api_service/delete_resource.py +240 -0
  12. capo_cloudcontrol/_operations/cloud_api_service/get_resource.py +230 -0
  13. capo_cloudcontrol/_operations/cloud_api_service/get_resource_request_status.py +151 -0
  14. capo_cloudcontrol/_operations/cloud_api_service/list_resource_requests.py +146 -0
  15. capo_cloudcontrol/_operations/cloud_api_service/list_resources.py +230 -0
  16. capo_cloudcontrol/_operations/cloud_api_service/update_resource.py +240 -0
  17. capo_cloudcontrol/_pagination.py +21 -0
  18. capo_cloudcontrol/_protocol/__init__.py +1 -0
  19. capo_cloudcontrol/_protocol/errors.py +93 -0
  20. capo_cloudcontrol/_protocol/eventstream.py +238 -0
  21. capo_cloudcontrol/_protocol/serialize.py +47 -0
  22. capo_cloudcontrol/_protocol/xml.py +33 -0
  23. capo_cloudcontrol/_rule_engine/__init__.py +0 -0
  24. capo_cloudcontrol/_rule_engine/_aws_partition.py +160 -0
  25. capo_cloudcontrol/_rule_engine/_endpoint_rule_set.py +138 -0
  26. capo_cloudcontrol/_rule_engine/_endpoint_runtime.py +389 -0
  27. capo_cloudcontrol/_services/_aws_config.py +160 -0
  28. capo_cloudcontrol/_services/_pipeline.py +198 -0
  29. capo_cloudcontrol/_services/async_cloud_control.py +772 -0
  30. capo_cloudcontrol/_services/cloud_control.py +764 -0
  31. capo_cloudcontrol/errors/__init__.py +74 -0
  32. capo_cloudcontrol/errors/_base.py +94 -0
  33. capo_cloudcontrol/errors/already_exists_exception.py +51 -0
  34. capo_cloudcontrol/errors/client_token_conflict_exception.py +51 -0
  35. capo_cloudcontrol/errors/concurrent_modification_exception.py +53 -0
  36. capo_cloudcontrol/errors/concurrent_operation_exception.py +51 -0
  37. capo_cloudcontrol/errors/general_service_exception.py +51 -0
  38. capo_cloudcontrol/errors/handler_failure_exception.py +51 -0
  39. capo_cloudcontrol/errors/handler_internal_failure_exception.py +53 -0
  40. capo_cloudcontrol/errors/invalid_credentials_exception.py +51 -0
  41. capo_cloudcontrol/errors/invalid_request_exception.py +51 -0
  42. capo_cloudcontrol/errors/network_failure_exception.py +51 -0
  43. capo_cloudcontrol/errors/not_stabilized_exception.py +51 -0
  44. capo_cloudcontrol/errors/not_updatable_exception.py +51 -0
  45. capo_cloudcontrol/errors/private_type_exception.py +51 -0
  46. capo_cloudcontrol/errors/request_token_not_found_exception.py +53 -0
  47. capo_cloudcontrol/errors/resource_conflict_exception.py +51 -0
  48. capo_cloudcontrol/errors/resource_not_found_exception.py +51 -0
  49. capo_cloudcontrol/errors/service_internal_error_exception.py +53 -0
  50. capo_cloudcontrol/errors/service_limit_exceeded_exception.py +53 -0
  51. capo_cloudcontrol/errors/throttling_exception.py +51 -0
  52. capo_cloudcontrol/errors/type_not_found_exception.py +51 -0
  53. capo_cloudcontrol/errors/unsupported_action_exception.py +51 -0
  54. capo_cloudcontrol/py.typed +0 -0
  55. capo_cloudcontrol/types/_prelude/blob.py +12 -0
  56. capo_cloudcontrol/types/_prelude/timestamp.py +17 -0
  57. capo_cloudcontrol/types/cancel_resource_request_input.py +31 -0
  58. capo_cloudcontrol/types/cancel_resource_request_output.py +39 -0
  59. capo_cloudcontrol/types/client_token.py +5 -0
  60. capo_cloudcontrol/types/create_resource_input.py +62 -0
  61. capo_cloudcontrol/types/create_resource_output.py +40 -0
  62. capo_cloudcontrol/types/delete_resource_input.py +62 -0
  63. capo_cloudcontrol/types/delete_resource_output.py +40 -0
  64. capo_cloudcontrol/types/error_message.py +5 -0
  65. capo_cloudcontrol/types/get_resource_input.py +55 -0
  66. capo_cloudcontrol/types/get_resource_output.py +48 -0
  67. capo_cloudcontrol/types/get_resource_request_status_input.py +33 -0
  68. capo_cloudcontrol/types/get_resource_request_status_output.py +61 -0
  69. capo_cloudcontrol/types/handler_error_code.py +5 -0
  70. capo_cloudcontrol/types/handler_next_token.py +5 -0
  71. capo_cloudcontrol/types/hook_failure_mode.py +5 -0
  72. capo_cloudcontrol/types/hook_invocation_point.py +5 -0
  73. capo_cloudcontrol/types/hook_progress_event.py +95 -0
  74. capo_cloudcontrol/types/hook_status.py +5 -0
  75. capo_cloudcontrol/types/hook_type_arn.py +5 -0
  76. capo_cloudcontrol/types/hooks_progress_event.py +35 -0
  77. capo_cloudcontrol/types/identifier.py +5 -0
  78. capo_cloudcontrol/types/list_resource_requests_input.py +56 -0
  79. capo_cloudcontrol/types/list_resource_requests_output.py +49 -0
  80. capo_cloudcontrol/types/list_resources_input.py +70 -0
  81. capo_cloudcontrol/types/list_resources_output.py +58 -0
  82. capo_cloudcontrol/types/max_results.py +5 -0
  83. capo_cloudcontrol/types/next_token.py +5 -0
  84. capo_cloudcontrol/types/operation.py +5 -0
  85. capo_cloudcontrol/types/operation_status.py +5 -0
  86. capo_cloudcontrol/types/operation_statuses.py +19 -0
  87. capo_cloudcontrol/types/operations.py +17 -0
  88. capo_cloudcontrol/types/patch_document.py +6 -0
  89. capo_cloudcontrol/types/progress_event.py +118 -0
  90. capo_cloudcontrol/types/properties.py +6 -0
  91. capo_cloudcontrol/types/request_token.py +5 -0
  92. capo_cloudcontrol/types/resource_description.py +35 -0
  93. capo_cloudcontrol/types/resource_descriptions.py +35 -0
  94. capo_cloudcontrol/types/resource_request_status_filter.py +57 -0
  95. capo_cloudcontrol/types/resource_request_status_summaries.py +33 -0
  96. capo_cloudcontrol/types/role_arn.py +5 -0
  97. capo_cloudcontrol/types/status_message.py +5 -0
  98. capo_cloudcontrol/types/timestamp.py +20 -0
  99. capo_cloudcontrol/types/type_name.py +5 -0
  100. capo_cloudcontrol/types/type_version_id.py +5 -0
  101. capo_cloudcontrol/types/update_resource_input.py +70 -0
  102. capo_cloudcontrol/types/update_resource_output.py +40 -0
  103. capo_cloudcontrol-0.1.0.dist-info/METADATA +102 -0
  104. capo_cloudcontrol-0.1.0.dist-info/RECORD +107 -0
  105. capo_cloudcontrol-0.1.0.dist-info/WHEEL +5 -0
  106. capo_cloudcontrol-0.1.0.dist-info/licenses/LICENSE +21 -0
  107. capo_cloudcontrol-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,772 @@
1
+ """Generated from Smithy shape ``com.amazonaws.cloudcontrol#CloudApiService``."""
2
+
3
+ import uuid
4
+ import warnings
5
+ from collections.abc import AsyncIterator
6
+ from typing import TYPE_CHECKING, Any, Iterable, Optional
7
+
8
+ from typing_extensions import Self, TypedDict
9
+ from zapros import AsyncBaseHandler, AsyncClient
10
+
11
+ import capo_cloudcontrol._auth._signers
12
+ import capo_cloudcontrol._auth._sigv4
13
+ from capo_cloudcontrol._auth._identity import Credentials
14
+ from capo_cloudcontrol._auth._providers import (
15
+ CredentialsProvider,
16
+ IdentityProvider,
17
+ StaticAwsCredentialsProvider,
18
+ default_aws_credentials_chain,
19
+ )
20
+ from capo_cloudcontrol._auth._zapros_handler import AuthMiddleware
21
+ from capo_cloudcontrol._pagination import resolve_path as _resolve_path
22
+ from capo_cloudcontrol._services._aws_config import aaws_config
23
+ from capo_cloudcontrol._services._pipeline import (
24
+ AsyncInterceptor,
25
+ AsyncOperationOptions,
26
+ AsyncOperationRequest,
27
+ AsyncOperationResponse,
28
+ aexecute_pipeline,
29
+ aretry,
30
+ )
31
+
32
+ if TYPE_CHECKING:
33
+ import capo_cloudcontrol.types.cancel_resource_request_input
34
+ import capo_cloudcontrol.types.cancel_resource_request_output
35
+ import capo_cloudcontrol.types.client_token
36
+ import capo_cloudcontrol.types.create_resource_input
37
+ import capo_cloudcontrol.types.create_resource_output
38
+ import capo_cloudcontrol.types.delete_resource_input
39
+ import capo_cloudcontrol.types.delete_resource_output
40
+ import capo_cloudcontrol.types.get_resource_input
41
+ import capo_cloudcontrol.types.get_resource_output
42
+ import capo_cloudcontrol.types.get_resource_request_status_input
43
+ import capo_cloudcontrol.types.get_resource_request_status_output
44
+ import capo_cloudcontrol.types.handler_next_token
45
+ import capo_cloudcontrol.types.identifier
46
+ import capo_cloudcontrol.types.list_resource_requests_input
47
+ import capo_cloudcontrol.types.list_resource_requests_output
48
+ import capo_cloudcontrol.types.list_resources_input
49
+ import capo_cloudcontrol.types.list_resources_output
50
+ import capo_cloudcontrol.types.max_results
51
+ import capo_cloudcontrol.types.next_token
52
+ import capo_cloudcontrol.types.patch_document
53
+ import capo_cloudcontrol.types.progress_event
54
+ import capo_cloudcontrol.types.properties
55
+ import capo_cloudcontrol.types.request_token
56
+ import capo_cloudcontrol.types.resource_description
57
+ import capo_cloudcontrol.types.resource_request_status_filter
58
+ import capo_cloudcontrol.types.role_arn
59
+ import capo_cloudcontrol.types.type_name
60
+ import capo_cloudcontrol.types.type_version_id
61
+ import capo_cloudcontrol.types.update_resource_input
62
+ import capo_cloudcontrol.types.update_resource_output
63
+
64
+
65
+ class AsyncCloudControlClientConfig(TypedDict, total=False, closed=True):
66
+ operation_interceptors: Iterable[AsyncInterceptor[Any, Any]]
67
+ retry_max_attempts: int | None
68
+ region: str | None
69
+ use_dual_stack: bool | None
70
+ use_fips: bool | None
71
+ endpoint: str | None
72
+ credentials_provider: IdentityProvider[Credentials] | None
73
+
74
+
75
+ class AsyncCloudControlClient:
76
+ """A client for the ``CloudControl`` service.
77
+
78
+ Args:
79
+ http_handler: HTTP handler for sending requests. If not provided, creates a default handler.
80
+ operation_interceptors: Interceptors that wrap every operation call. If not provided, defaults to an empty list.
81
+ retry_max_attempts: Maximum number of times to retry a failed operation. Defaults to 3.
82
+ region: The value of the ``AWS::Region`` endpoint parameter.
83
+ use_dual_stack: The value of the ``AWS::UseDualStack`` endpoint parameter.
84
+ use_fips: The value of the ``AWS::UseFIPS`` endpoint parameter.
85
+ endpoint: The value of the ``SDK::Endpoint`` endpoint parameter.
86
+ credentials: AWS credentials for request signing.
87
+ credentials_provider: Provider that resolves AWS credentials. Takes precedence over ``credentials``.
88
+ """
89
+
90
+ def __init__(
91
+ self,
92
+ http_handler: AsyncBaseHandler | None = None,
93
+ operation_interceptors: Iterable[AsyncInterceptor[Any, Any]] | None = None,
94
+ retry_max_attempts: int | None = None,
95
+ region: str | None = None,
96
+ use_dual_stack: bool | None = None,
97
+ use_fips: bool | None = None,
98
+ endpoint: str | None = None,
99
+ credentials: Credentials | None = None,
100
+ credentials_provider: CredentialsProvider | None = None,
101
+ ):
102
+ self._client = AsyncClient(http_handler).wrap_with_middleware(
103
+ lambda next: AuthMiddleware(next)
104
+ )
105
+ if credentials is not None and credentials_provider is not None:
106
+ warnings.warn(
107
+ "Both credentials and credentials_provider given; provider takes precedence"
108
+ )
109
+ resolved_credentials_provider: IdentityProvider[Credentials] | None = (
110
+ credentials_provider
111
+ )
112
+ if resolved_credentials_provider is None and credentials is not None:
113
+ resolved_credentials_provider = StaticAwsCredentialsProvider(credentials)
114
+ if resolved_credentials_provider is None and credentials is None:
115
+ resolved_credentials_provider = default_aws_credentials_chain(
116
+ AsyncClient(http_handler)
117
+ )
118
+ self._config = AsyncCloudControlClientConfig(
119
+ {
120
+ "operation_interceptors": operation_interceptors or [],
121
+ "retry_max_attempts": retry_max_attempts,
122
+ "region": region,
123
+ "use_dual_stack": use_dual_stack,
124
+ "use_fips": use_fips,
125
+ "endpoint": endpoint,
126
+ "credentials_provider": resolved_credentials_provider,
127
+ }
128
+ )
129
+
130
+ def operation_options(
131
+ self, config_overrides: Optional[AsyncCloudControlClientConfig] = None
132
+ ) -> tuple[Iterable[AsyncInterceptor[Any, Any]], AsyncOperationOptions]:
133
+ overrides: AsyncCloudControlClientConfig = config_overrides or {}
134
+ interceptors_: list[AsyncInterceptor[Any, Any]] = [
135
+ *overrides.get(
136
+ "operation_interceptors", self._config.get("operation_interceptors", [])
137
+ ),
138
+ aaws_config(),
139
+ aretry(),
140
+ ]
141
+ options_: AsyncOperationOptions = AsyncOperationOptions(
142
+ client=self._client,
143
+ retry_max_attempts=overrides.get(
144
+ "retry_max_attempts", self._config.get("retry_max_attempts")
145
+ ),
146
+ region=overrides.get("region", self._config.get("region")),
147
+ use_dual_stack=overrides.get(
148
+ "use_dual_stack", self._config.get("use_dual_stack")
149
+ ),
150
+ use_fips=overrides.get("use_fips", self._config.get("use_fips")),
151
+ endpoint=overrides.get("endpoint", self._config.get("endpoint")),
152
+ credentials_provider=overrides.get(
153
+ "credentials_provider", self._config.get("credentials_provider")
154
+ ),
155
+ )
156
+ return interceptors_, options_
157
+
158
+ async def cancel_resource_request(
159
+ self,
160
+ request_token: "capo_cloudcontrol.types.request_token.RequestToken",
161
+ *,
162
+ config_overrides: Optional[AsyncCloudControlClientConfig] = None,
163
+ ) -> "capo_cloudcontrol.types.cancel_resource_request_output.CancelResourceRequestOutput":
164
+ r"""<p>Cancels the specified resource operation request. For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html#resource-operations-manage-requests-cancel\">Canceling resource operation requests</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p> <p>Only resource operations requests with a status of <code>PENDING</code> or <code>IN_PROGRESS</code> can be canceled.</p>
165
+
166
+ Args:
167
+ request_token: <p>The <code>RequestToken</code> of the <code>ProgressEvent</code> object returned by the resource operation request.</p>
168
+
169
+ Raises:
170
+ capo_cloudcontrol.errors.concurrent_modification_exception.ConcurrentModificationException: <p>The resource is currently being modified by another operation.</p>
171
+ capo_cloudcontrol.errors.request_token_not_found_exception.RequestTokenNotFoundException: <p>A resource operation with the specified request token can't be found.</p>
172
+ capo_cloudcontrol.errors.UnknownServiceError: The service returned an error code this client does not model.
173
+ """
174
+
175
+ async def _handler(
176
+ req: "AsyncOperationRequest[capo_cloudcontrol.types.cancel_resource_request_input.CancelResourceRequestInput]",
177
+ ) -> AsyncOperationResponse[
178
+ "capo_cloudcontrol.types.cancel_resource_request_output.CancelResourceRequestOutput"
179
+ ]:
180
+ import capo_cloudcontrol._operations.cloud_api_service.cancel_resource_request
181
+
182
+ (
183
+ output,
184
+ http_response,
185
+ ) = await capo_cloudcontrol._operations.cloud_api_service.cancel_resource_request.async_cancel_resource_request(
186
+ req.options, req.input
187
+ )
188
+ return AsyncOperationResponse(output=output, response=http_response)
189
+
190
+ interceptors_, options_ = self.operation_options(config_overrides)
191
+ input_: capo_cloudcontrol.types.cancel_resource_request_input.CancelResourceRequestInput = {
192
+ "request_token": request_token
193
+ }
194
+
195
+ response = await aexecute_pipeline(
196
+ AsyncOperationRequest(input=input_, options=options_),
197
+ handler=_handler,
198
+ interceptors=list(interceptors_),
199
+ )
200
+ await response.response.aclose()
201
+ return response.output
202
+
203
+ async def create_resource(
204
+ self,
205
+ type_name: "capo_cloudcontrol.types.type_name.TypeName",
206
+ desired_state: "capo_cloudcontrol.types.properties.Properties",
207
+ *,
208
+ config_overrides: Optional[AsyncCloudControlClientConfig] = None,
209
+ type_version_id: Optional[
210
+ "capo_cloudcontrol.types.type_version_id.TypeVersionId"
211
+ ] = None,
212
+ role_arn: Optional["capo_cloudcontrol.types.role_arn.RoleArn"] = None,
213
+ client_token: Optional[
214
+ "capo_cloudcontrol.types.client_token.ClientToken"
215
+ ] = None,
216
+ ) -> "capo_cloudcontrol.types.create_resource_output.CreateResourceOutput":
217
+ r"""<p>Creates the specified resource. For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-create.html\">Creating a resource</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p> <p>After you have initiated a resource creation request, you can monitor the progress of your request by calling <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html\">GetResourceRequestStatus</a> using the <code>RequestToken</code> of the <code>ProgressEvent</code> type returned by <code>CreateResource</code>.</p>
218
+
219
+ Args:
220
+ type_name: <p>The name of the resource type.</p>
221
+ type_version_id: <p>For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.</p>
222
+ role_arn: <p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the <code> <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers\">handlers</a> </code> section of the <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html\">resource type definition schema</a>.</p> <p>If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions\">Specifying credentials</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
223
+ client_token: <p>A unique identifier to ensure the idempotency of the resource request. As a best practice, specify this token to ensure idempotency, so that Amazon Web Services Cloud Control API can accurately distinguish between request retries and new resource requests. You might retry a resource request to ensure that it was successfully received.</p> <p>A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request.</p> <p>If you do not specify a client token, one is generated for inclusion in the request.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency\">Ensuring resource operation requests are unique</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
224
+ desired_state: <p>Structured data format representing the desired state of the resource, consisting of that resource's properties and their desired values.</p> <note> <p>Cloud Control API currently supports JSON as a structured data format.</p> </note> <p>Specify the desired state as one of the following:</p> <ul> <li> <p>A JSON blob</p> </li> <li> <p>A local path containing the desired state in JSON data format</p> </li> </ul> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-create.html#resource-operations-create-desiredstate\">Composing the desired state of the resource</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p> <p>For more information about the properties of a specific resource, refer to the related topic for the resource in the <a href=\"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html\">Resource and property types reference</a> in the <i>CloudFormation Users Guide</i>.</p>
225
+
226
+ Raises:
227
+ capo_cloudcontrol.errors.already_exists_exception.AlreadyExistsException: <p>The resource with the name requested already exists.</p>
228
+ capo_cloudcontrol.errors.client_token_conflict_exception.ClientTokenConflictException: <p>The specified client token has already been used in another resource request.</p> <p>It's best practice for client tokens to be unique for each resource operation request. However, client token expire after 36 hours.</p>
229
+ capo_cloudcontrol.errors.concurrent_operation_exception.ConcurrentOperationException: <p>Another resource operation is currently being performed on this resource.</p>
230
+ capo_cloudcontrol.errors.general_service_exception.GeneralServiceException: <p>The resource handler has returned that the downstream service generated an error that doesn't map to any other handler error code.</p>
231
+ capo_cloudcontrol.errors.handler_failure_exception.HandlerFailureException: <p>The resource handler has failed without a returning a more specific error code. This can include timeouts.</p>
232
+ capo_cloudcontrol.errors.handler_internal_failure_exception.HandlerInternalFailureException: <p>The resource handler has returned that an unexpected error occurred within the resource handler.</p>
233
+ capo_cloudcontrol.errors.invalid_credentials_exception.InvalidCredentialsException: <p>The resource handler has returned that the credentials provided by the user are invalid.</p>
234
+ capo_cloudcontrol.errors.invalid_request_exception.InvalidRequestException: <p>The resource handler has returned that invalid input from the user has generated a generic exception.</p>
235
+ capo_cloudcontrol.errors.network_failure_exception.NetworkFailureException: <p>The resource handler has returned that the request couldn't be completed due to networking issues, such as a failure to receive a response from the server.</p>
236
+ capo_cloudcontrol.errors.not_stabilized_exception.NotStabilizedException: <p>The resource handler has returned that the downstream resource failed to complete all of its ready-state checks.</p>
237
+ capo_cloudcontrol.errors.not_updatable_exception.NotUpdatableException: <p>One or more properties included in this resource operation are defined as create-only, and therefore can't be updated.</p>
238
+ capo_cloudcontrol.errors.private_type_exception.PrivateTypeException: <p>Cloud Control API hasn't received a valid response from the resource handler, due to a configuration error. This includes issues such as the resource handler returning an invalid response, or timing out.</p>
239
+ capo_cloudcontrol.errors.resource_conflict_exception.ResourceConflictException: <p>The resource is temporarily unavailable to be acted upon. For example, if the resource is currently undergoing an operation and can't be acted upon until that operation is finished.</p>
240
+ capo_cloudcontrol.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource with the specified identifier can't be found.</p>
241
+ capo_cloudcontrol.errors.service_internal_error_exception.ServiceInternalErrorException: <p>The resource handler has returned that the downstream service returned an internal error, typically with a <code>5XX HTTP</code> status code.</p>
242
+ capo_cloudcontrol.errors.service_limit_exceeded_exception.ServiceLimitExceededException: <p>The resource handler has returned that a non-transient resource limit was reached on the service side.</p>
243
+ capo_cloudcontrol.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
244
+ capo_cloudcontrol.errors.type_not_found_exception.TypeNotFoundException: <p>The specified extension doesn't exist in the CloudFormation registry.</p>
245
+ capo_cloudcontrol.errors.unsupported_action_exception.UnsupportedActionException: <p>The specified resource doesn't support this resource operation.</p>
246
+ capo_cloudcontrol.errors.UnknownServiceError: The service returned an error code this client does not model.
247
+ """
248
+
249
+ async def _handler(
250
+ req: "AsyncOperationRequest[capo_cloudcontrol.types.create_resource_input.CreateResourceInput]",
251
+ ) -> AsyncOperationResponse[
252
+ "capo_cloudcontrol.types.create_resource_output.CreateResourceOutput"
253
+ ]:
254
+ import capo_cloudcontrol._operations.cloud_api_service.create_resource
255
+
256
+ (
257
+ output,
258
+ http_response,
259
+ ) = await capo_cloudcontrol._operations.cloud_api_service.create_resource.async_create_resource(
260
+ req.options, req.input
261
+ )
262
+ return AsyncOperationResponse(output=output, response=http_response)
263
+
264
+ interceptors_, options_ = self.operation_options(config_overrides)
265
+ input_: capo_cloudcontrol.types.create_resource_input.CreateResourceInput = {
266
+ "type_name": type_name,
267
+ "desired_state": desired_state,
268
+ }
269
+ if type_version_id is not None:
270
+ input_["type_version_id"] = type_version_id
271
+ if role_arn is not None:
272
+ input_["role_arn"] = role_arn
273
+ if client_token is None:
274
+ client_token = str(uuid.uuid4())
275
+ input_["client_token"] = client_token
276
+
277
+ response = await aexecute_pipeline(
278
+ AsyncOperationRequest(input=input_, options=options_),
279
+ handler=_handler,
280
+ interceptors=list(interceptors_),
281
+ )
282
+ await response.response.aclose()
283
+ return response.output
284
+
285
+ async def delete_resource(
286
+ self,
287
+ type_name: "capo_cloudcontrol.types.type_name.TypeName",
288
+ identifier: "capo_cloudcontrol.types.identifier.Identifier",
289
+ *,
290
+ config_overrides: Optional[AsyncCloudControlClientConfig] = None,
291
+ type_version_id: Optional[
292
+ "capo_cloudcontrol.types.type_version_id.TypeVersionId"
293
+ ] = None,
294
+ role_arn: Optional["capo_cloudcontrol.types.role_arn.RoleArn"] = None,
295
+ client_token: Optional[
296
+ "capo_cloudcontrol.types.client_token.ClientToken"
297
+ ] = None,
298
+ ) -> "capo_cloudcontrol.types.delete_resource_output.DeleteResourceOutput":
299
+ r"""<p>Deletes the specified resource. For details, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-delete.html\">Deleting a resource</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p> <p>After you have initiated a resource deletion request, you can monitor the progress of your request by calling <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html\">GetResourceRequestStatus</a> using the <code>RequestToken</code> of the <code>ProgressEvent</code> returned by <code>DeleteResource</code>.</p>
300
+
301
+ Args:
302
+ type_name: <p>The name of the resource type.</p>
303
+ type_version_id: <p>For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.</p>
304
+ role_arn: <p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the <code> <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers\">handlers</a> </code> section of the <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html\">resource type definition schema</a>.</p> <p>If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions\">Specifying credentials</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
305
+ client_token: <p>A unique identifier to ensure the idempotency of the resource request. As a best practice, specify this token to ensure idempotency, so that Amazon Web Services Cloud Control API can accurately distinguish between request retries and new resource requests. You might retry a resource request to ensure that it was successfully received.</p> <p>A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request.</p> <p>If you do not specify a client token, one is generated for inclusion in the request.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency\">Ensuring resource operation requests are unique</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
306
+ identifier: <p>The identifier for the resource.</p> <p>You can specify the primary identifier, or any secondary identifier defined for the resource type in its resource schema. You can only specify one identifier. Primary identifiers can be specified as a string or JSON; secondary identifiers must be specified as JSON.</p> <p>For compound primary identifiers (that is, one that consists of multiple resource properties strung together), to specify the primary identifier as a string, list the property values <i>in the order they are specified</i> in the primary identifier definition, separated by <code>|</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html\">Identifying resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
307
+
308
+ Raises:
309
+ capo_cloudcontrol.errors.already_exists_exception.AlreadyExistsException: <p>The resource with the name requested already exists.</p>
310
+ capo_cloudcontrol.errors.client_token_conflict_exception.ClientTokenConflictException: <p>The specified client token has already been used in another resource request.</p> <p>It's best practice for client tokens to be unique for each resource operation request. However, client token expire after 36 hours.</p>
311
+ capo_cloudcontrol.errors.concurrent_operation_exception.ConcurrentOperationException: <p>Another resource operation is currently being performed on this resource.</p>
312
+ capo_cloudcontrol.errors.general_service_exception.GeneralServiceException: <p>The resource handler has returned that the downstream service generated an error that doesn't map to any other handler error code.</p>
313
+ capo_cloudcontrol.errors.handler_failure_exception.HandlerFailureException: <p>The resource handler has failed without a returning a more specific error code. This can include timeouts.</p>
314
+ capo_cloudcontrol.errors.handler_internal_failure_exception.HandlerInternalFailureException: <p>The resource handler has returned that an unexpected error occurred within the resource handler.</p>
315
+ capo_cloudcontrol.errors.invalid_credentials_exception.InvalidCredentialsException: <p>The resource handler has returned that the credentials provided by the user are invalid.</p>
316
+ capo_cloudcontrol.errors.invalid_request_exception.InvalidRequestException: <p>The resource handler has returned that invalid input from the user has generated a generic exception.</p>
317
+ capo_cloudcontrol.errors.network_failure_exception.NetworkFailureException: <p>The resource handler has returned that the request couldn't be completed due to networking issues, such as a failure to receive a response from the server.</p>
318
+ capo_cloudcontrol.errors.not_stabilized_exception.NotStabilizedException: <p>The resource handler has returned that the downstream resource failed to complete all of its ready-state checks.</p>
319
+ capo_cloudcontrol.errors.not_updatable_exception.NotUpdatableException: <p>One or more properties included in this resource operation are defined as create-only, and therefore can't be updated.</p>
320
+ capo_cloudcontrol.errors.private_type_exception.PrivateTypeException: <p>Cloud Control API hasn't received a valid response from the resource handler, due to a configuration error. This includes issues such as the resource handler returning an invalid response, or timing out.</p>
321
+ capo_cloudcontrol.errors.resource_conflict_exception.ResourceConflictException: <p>The resource is temporarily unavailable to be acted upon. For example, if the resource is currently undergoing an operation and can't be acted upon until that operation is finished.</p>
322
+ capo_cloudcontrol.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource with the specified identifier can't be found.</p>
323
+ capo_cloudcontrol.errors.service_internal_error_exception.ServiceInternalErrorException: <p>The resource handler has returned that the downstream service returned an internal error, typically with a <code>5XX HTTP</code> status code.</p>
324
+ capo_cloudcontrol.errors.service_limit_exceeded_exception.ServiceLimitExceededException: <p>The resource handler has returned that a non-transient resource limit was reached on the service side.</p>
325
+ capo_cloudcontrol.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
326
+ capo_cloudcontrol.errors.type_not_found_exception.TypeNotFoundException: <p>The specified extension doesn't exist in the CloudFormation registry.</p>
327
+ capo_cloudcontrol.errors.unsupported_action_exception.UnsupportedActionException: <p>The specified resource doesn't support this resource operation.</p>
328
+ capo_cloudcontrol.errors.UnknownServiceError: The service returned an error code this client does not model.
329
+ """
330
+
331
+ async def _handler(
332
+ req: "AsyncOperationRequest[capo_cloudcontrol.types.delete_resource_input.DeleteResourceInput]",
333
+ ) -> AsyncOperationResponse[
334
+ "capo_cloudcontrol.types.delete_resource_output.DeleteResourceOutput"
335
+ ]:
336
+ import capo_cloudcontrol._operations.cloud_api_service.delete_resource
337
+
338
+ (
339
+ output,
340
+ http_response,
341
+ ) = await capo_cloudcontrol._operations.cloud_api_service.delete_resource.async_delete_resource(
342
+ req.options, req.input
343
+ )
344
+ return AsyncOperationResponse(output=output, response=http_response)
345
+
346
+ interceptors_, options_ = self.operation_options(config_overrides)
347
+ input_: capo_cloudcontrol.types.delete_resource_input.DeleteResourceInput = {
348
+ "type_name": type_name,
349
+ "identifier": identifier,
350
+ }
351
+ if type_version_id is not None:
352
+ input_["type_version_id"] = type_version_id
353
+ if role_arn is not None:
354
+ input_["role_arn"] = role_arn
355
+ if client_token is None:
356
+ client_token = str(uuid.uuid4())
357
+ input_["client_token"] = client_token
358
+
359
+ response = await aexecute_pipeline(
360
+ AsyncOperationRequest(input=input_, options=options_),
361
+ handler=_handler,
362
+ interceptors=list(interceptors_),
363
+ )
364
+ await response.response.aclose()
365
+ return response.output
366
+
367
+ async def get_resource(
368
+ self,
369
+ type_name: "capo_cloudcontrol.types.type_name.TypeName",
370
+ identifier: "capo_cloudcontrol.types.identifier.Identifier",
371
+ *,
372
+ config_overrides: Optional[AsyncCloudControlClientConfig] = None,
373
+ type_version_id: Optional[
374
+ "capo_cloudcontrol.types.type_version_id.TypeVersionId"
375
+ ] = None,
376
+ role_arn: Optional["capo_cloudcontrol.types.role_arn.RoleArn"] = None,
377
+ ) -> "capo_cloudcontrol.types.get_resource_output.GetResourceOutput":
378
+ r"""<p>Returns information about the current state of the specified resource. For details, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-read.html\">Reading a resource's current state</a>.</p> <p>You can use this action to return information about an existing resource in your account and Amazon Web Services Region, whether those resources were provisioned using Cloud Control API.</p>
379
+
380
+ Args:
381
+ type_name: <p>The name of the resource type.</p>
382
+ type_version_id: <p>For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.</p>
383
+ role_arn: <p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the <code> <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers\">handlers</a> </code> section of the <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html\">resource type definition schema</a>.</p> <p>If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions\">Specifying credentials</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
384
+ identifier: <p>The identifier for the resource.</p> <p>You can specify the primary identifier, or any secondary identifier defined for the resource type in its resource schema. You can only specify one identifier. Primary identifiers can be specified as a string or JSON; secondary identifiers must be specified as JSON.</p> <p>For compound primary identifiers (that is, one that consists of multiple resource properties strung together), to specify the primary identifier as a string, list the property values <i>in the order they are specified</i> in the primary identifier definition, separated by <code>|</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html\">Identifying resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
385
+
386
+ Raises:
387
+ capo_cloudcontrol.errors.already_exists_exception.AlreadyExistsException: <p>The resource with the name requested already exists.</p>
388
+ capo_cloudcontrol.errors.general_service_exception.GeneralServiceException: <p>The resource handler has returned that the downstream service generated an error that doesn't map to any other handler error code.</p>
389
+ capo_cloudcontrol.errors.handler_failure_exception.HandlerFailureException: <p>The resource handler has failed without a returning a more specific error code. This can include timeouts.</p>
390
+ capo_cloudcontrol.errors.handler_internal_failure_exception.HandlerInternalFailureException: <p>The resource handler has returned that an unexpected error occurred within the resource handler.</p>
391
+ capo_cloudcontrol.errors.invalid_credentials_exception.InvalidCredentialsException: <p>The resource handler has returned that the credentials provided by the user are invalid.</p>
392
+ capo_cloudcontrol.errors.invalid_request_exception.InvalidRequestException: <p>The resource handler has returned that invalid input from the user has generated a generic exception.</p>
393
+ capo_cloudcontrol.errors.network_failure_exception.NetworkFailureException: <p>The resource handler has returned that the request couldn't be completed due to networking issues, such as a failure to receive a response from the server.</p>
394
+ capo_cloudcontrol.errors.not_stabilized_exception.NotStabilizedException: <p>The resource handler has returned that the downstream resource failed to complete all of its ready-state checks.</p>
395
+ capo_cloudcontrol.errors.not_updatable_exception.NotUpdatableException: <p>One or more properties included in this resource operation are defined as create-only, and therefore can't be updated.</p>
396
+ capo_cloudcontrol.errors.private_type_exception.PrivateTypeException: <p>Cloud Control API hasn't received a valid response from the resource handler, due to a configuration error. This includes issues such as the resource handler returning an invalid response, or timing out.</p>
397
+ capo_cloudcontrol.errors.resource_conflict_exception.ResourceConflictException: <p>The resource is temporarily unavailable to be acted upon. For example, if the resource is currently undergoing an operation and can't be acted upon until that operation is finished.</p>
398
+ capo_cloudcontrol.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource with the specified identifier can't be found.</p>
399
+ capo_cloudcontrol.errors.service_internal_error_exception.ServiceInternalErrorException: <p>The resource handler has returned that the downstream service returned an internal error, typically with a <code>5XX HTTP</code> status code.</p>
400
+ capo_cloudcontrol.errors.service_limit_exceeded_exception.ServiceLimitExceededException: <p>The resource handler has returned that a non-transient resource limit was reached on the service side.</p>
401
+ capo_cloudcontrol.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
402
+ capo_cloudcontrol.errors.type_not_found_exception.TypeNotFoundException: <p>The specified extension doesn't exist in the CloudFormation registry.</p>
403
+ capo_cloudcontrol.errors.unsupported_action_exception.UnsupportedActionException: <p>The specified resource doesn't support this resource operation.</p>
404
+ capo_cloudcontrol.errors.UnknownServiceError: The service returned an error code this client does not model.
405
+ """
406
+
407
+ async def _handler(
408
+ req: "AsyncOperationRequest[capo_cloudcontrol.types.get_resource_input.GetResourceInput]",
409
+ ) -> AsyncOperationResponse[
410
+ "capo_cloudcontrol.types.get_resource_output.GetResourceOutput"
411
+ ]:
412
+ import capo_cloudcontrol._operations.cloud_api_service.get_resource
413
+
414
+ (
415
+ output,
416
+ http_response,
417
+ ) = await capo_cloudcontrol._operations.cloud_api_service.get_resource.async_get_resource(
418
+ req.options, req.input
419
+ )
420
+ return AsyncOperationResponse(output=output, response=http_response)
421
+
422
+ interceptors_, options_ = self.operation_options(config_overrides)
423
+ input_: capo_cloudcontrol.types.get_resource_input.GetResourceInput = {
424
+ "type_name": type_name,
425
+ "identifier": identifier,
426
+ }
427
+ if type_version_id is not None:
428
+ input_["type_version_id"] = type_version_id
429
+ if role_arn is not None:
430
+ input_["role_arn"] = role_arn
431
+
432
+ response = await aexecute_pipeline(
433
+ AsyncOperationRequest(input=input_, options=options_),
434
+ handler=_handler,
435
+ interceptors=list(interceptors_),
436
+ )
437
+ await response.response.aclose()
438
+ return response.output
439
+
440
+ async def get_resource_request_status(
441
+ self,
442
+ request_token: "capo_cloudcontrol.types.request_token.RequestToken",
443
+ *,
444
+ config_overrides: Optional[AsyncCloudControlClientConfig] = None,
445
+ ) -> "capo_cloudcontrol.types.get_resource_request_status_output.GetResourceRequestStatusOutput":
446
+ r"""<p>Returns the current status of a resource operation request. For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html#resource-operations-manage-requests-track\">Tracking the progress of resource operation requests</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
447
+
448
+ Args:
449
+ request_token: <p>A unique token used to track the progress of the resource operation request.</p> <p>Request tokens are included in the <code>ProgressEvent</code> type returned by a resource operation request.</p>
450
+
451
+ Raises:
452
+ capo_cloudcontrol.errors.request_token_not_found_exception.RequestTokenNotFoundException: <p>A resource operation with the specified request token can't be found.</p>
453
+ capo_cloudcontrol.errors.UnknownServiceError: The service returned an error code this client does not model.
454
+ """
455
+
456
+ async def _handler(
457
+ req: "AsyncOperationRequest[capo_cloudcontrol.types.get_resource_request_status_input.GetResourceRequestStatusInput]",
458
+ ) -> AsyncOperationResponse[
459
+ "capo_cloudcontrol.types.get_resource_request_status_output.GetResourceRequestStatusOutput"
460
+ ]:
461
+ import capo_cloudcontrol._operations.cloud_api_service.get_resource_request_status
462
+
463
+ (
464
+ output,
465
+ http_response,
466
+ ) = await capo_cloudcontrol._operations.cloud_api_service.get_resource_request_status.async_get_resource_request_status(
467
+ req.options, req.input
468
+ )
469
+ return AsyncOperationResponse(output=output, response=http_response)
470
+
471
+ interceptors_, options_ = self.operation_options(config_overrides)
472
+ input_: capo_cloudcontrol.types.get_resource_request_status_input.GetResourceRequestStatusInput = {
473
+ "request_token": request_token
474
+ }
475
+
476
+ response = await aexecute_pipeline(
477
+ AsyncOperationRequest(input=input_, options=options_),
478
+ handler=_handler,
479
+ interceptors=list(interceptors_),
480
+ )
481
+ await response.response.aclose()
482
+ return response.output
483
+
484
+ async def list_resource_requests(
485
+ self,
486
+ *,
487
+ config_overrides: Optional[AsyncCloudControlClientConfig] = None,
488
+ max_results: Optional["capo_cloudcontrol.types.max_results.MaxResults"] = None,
489
+ next_token: Optional["capo_cloudcontrol.types.next_token.NextToken"] = None,
490
+ resource_request_status_filter: Optional[
491
+ "capo_cloudcontrol.types.resource_request_status_filter.ResourceRequestStatusFilter"
492
+ ] = None,
493
+ ) -> "capo_cloudcontrol.types.list_resource_requests_output.ListResourceRequestsOutput":
494
+ r"""<p>Returns existing resource operation requests. This includes requests of all status types. For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html#resource-operations-manage-requests-list\">Listing active resource operation requests</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p> <note> <p>Resource operation requests expire after 7 days.</p> </note>
495
+
496
+ Args:
497
+ max_results: <p>The maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a <code>NextToken</code> value that you can assign to the <code>NextToken</code> request parameter to get the next set of results.</p> <p>The default is <code>20</code>.</p>
498
+ next_token: <p>If the previous paginated request didn't return all of the remaining results, the response object's <code>NextToken</code> parameter value is set to a token. To retrieve the next set of results, call this action again and assign that token to the request object's <code>NextToken</code> parameter. If there are no remaining results, the previous response object's <code>NextToken</code> parameter is set to <code>null</code>.</p>
499
+ resource_request_status_filter: <p>The filter criteria to apply to the requests returned.</p>
500
+
501
+ Raises:
502
+ capo_cloudcontrol.errors.UnknownServiceError: The service returned an error code this client does not model.
503
+ """
504
+
505
+ async def _handler(
506
+ req: "AsyncOperationRequest[capo_cloudcontrol.types.list_resource_requests_input.ListResourceRequestsInput]",
507
+ ) -> AsyncOperationResponse[
508
+ "capo_cloudcontrol.types.list_resource_requests_output.ListResourceRequestsOutput"
509
+ ]:
510
+ import capo_cloudcontrol._operations.cloud_api_service.list_resource_requests
511
+
512
+ (
513
+ output,
514
+ http_response,
515
+ ) = await capo_cloudcontrol._operations.cloud_api_service.list_resource_requests.async_list_resource_requests(
516
+ req.options, req.input
517
+ )
518
+ return AsyncOperationResponse(output=output, response=http_response)
519
+
520
+ interceptors_, options_ = self.operation_options(config_overrides)
521
+ input_: capo_cloudcontrol.types.list_resource_requests_input.ListResourceRequestsInput = {}
522
+ if max_results is not None:
523
+ input_["max_results"] = max_results
524
+ if next_token is not None:
525
+ input_["next_token"] = next_token
526
+ if resource_request_status_filter is not None:
527
+ input_["resource_request_status_filter"] = resource_request_status_filter
528
+
529
+ response = await aexecute_pipeline(
530
+ AsyncOperationRequest(input=input_, options=options_),
531
+ handler=_handler,
532
+ interceptors=list(interceptors_),
533
+ )
534
+ await response.response.aclose()
535
+ return response.output
536
+
537
+ async def iter_list_resource_requests(
538
+ self,
539
+ *,
540
+ config_overrides: Optional[AsyncCloudControlClientConfig] = None,
541
+ max_results: Optional["capo_cloudcontrol.types.max_results.MaxResults"] = None,
542
+ next_token: Optional["capo_cloudcontrol.types.next_token.NextToken"] = None,
543
+ resource_request_status_filter: Optional[
544
+ "capo_cloudcontrol.types.resource_request_status_filter.ResourceRequestStatusFilter"
545
+ ] = None,
546
+ ) -> "AsyncIterator[capo_cloudcontrol.types.progress_event.ProgressEvent]":
547
+ _token = next_token
548
+ while True:
549
+ _response = await self.list_resource_requests(
550
+ config_overrides=config_overrides,
551
+ max_results=max_results,
552
+ next_token=_token,
553
+ resource_request_status_filter=resource_request_status_filter,
554
+ )
555
+ _page = _resolve_path(_response, ("resource_request_status_summaries",))
556
+ for _item in _page or []:
557
+ yield _item
558
+ _token = _resolve_path(_response, ("next_token",))
559
+ if not _token:
560
+ break
561
+
562
+ async def list_resources(
563
+ self,
564
+ type_name: "capo_cloudcontrol.types.type_name.TypeName",
565
+ *,
566
+ config_overrides: Optional[AsyncCloudControlClientConfig] = None,
567
+ type_version_id: Optional[
568
+ "capo_cloudcontrol.types.type_version_id.TypeVersionId"
569
+ ] = None,
570
+ role_arn: Optional["capo_cloudcontrol.types.role_arn.RoleArn"] = None,
571
+ next_token: Optional[
572
+ "capo_cloudcontrol.types.handler_next_token.HandlerNextToken"
573
+ ] = None,
574
+ max_results: Optional["capo_cloudcontrol.types.max_results.MaxResults"] = None,
575
+ resource_model: Optional[
576
+ "capo_cloudcontrol.types.properties.Properties"
577
+ ] = None,
578
+ ) -> "capo_cloudcontrol.types.list_resources_output.ListResourcesOutput":
579
+ r"""<p>Returns information about the specified resources. For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-list.html\">Discovering resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p> <p>You can use this action to return information about existing resources in your account and Amazon Web Services Region, whether those resources were provisioned using Cloud Control API.</p>
580
+
581
+ Args:
582
+ type_name: <p>The name of the resource type.</p>
583
+ type_version_id: <p>For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.</p>
584
+ role_arn: <p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the <code> <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers\">handlers</a> </code> section of the <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html\">resource type definition schema</a>.</p> <p>If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions\">Specifying credentials</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
585
+ next_token: <p>If the previous paginated request didn't return all of the remaining results, the response object's <code>NextToken</code> parameter value is set to a token. To retrieve the next set of results, call this action again and assign that token to the request object's <code>NextToken</code> parameter. If there are no remaining results, the previous response object's <code>NextToken</code> parameter is set to <code>null</code>.</p>
586
+ max_results: <p>Reserved.</p>
587
+ resource_model: <p>The resource model to use to select the resources to return.</p>
588
+
589
+ Raises:
590
+ capo_cloudcontrol.errors.already_exists_exception.AlreadyExistsException: <p>The resource with the name requested already exists.</p>
591
+ capo_cloudcontrol.errors.general_service_exception.GeneralServiceException: <p>The resource handler has returned that the downstream service generated an error that doesn't map to any other handler error code.</p>
592
+ capo_cloudcontrol.errors.handler_failure_exception.HandlerFailureException: <p>The resource handler has failed without a returning a more specific error code. This can include timeouts.</p>
593
+ capo_cloudcontrol.errors.handler_internal_failure_exception.HandlerInternalFailureException: <p>The resource handler has returned that an unexpected error occurred within the resource handler.</p>
594
+ capo_cloudcontrol.errors.invalid_credentials_exception.InvalidCredentialsException: <p>The resource handler has returned that the credentials provided by the user are invalid.</p>
595
+ capo_cloudcontrol.errors.invalid_request_exception.InvalidRequestException: <p>The resource handler has returned that invalid input from the user has generated a generic exception.</p>
596
+ capo_cloudcontrol.errors.network_failure_exception.NetworkFailureException: <p>The resource handler has returned that the request couldn't be completed due to networking issues, such as a failure to receive a response from the server.</p>
597
+ capo_cloudcontrol.errors.not_stabilized_exception.NotStabilizedException: <p>The resource handler has returned that the downstream resource failed to complete all of its ready-state checks.</p>
598
+ capo_cloudcontrol.errors.not_updatable_exception.NotUpdatableException: <p>One or more properties included in this resource operation are defined as create-only, and therefore can't be updated.</p>
599
+ capo_cloudcontrol.errors.private_type_exception.PrivateTypeException: <p>Cloud Control API hasn't received a valid response from the resource handler, due to a configuration error. This includes issues such as the resource handler returning an invalid response, or timing out.</p>
600
+ capo_cloudcontrol.errors.resource_conflict_exception.ResourceConflictException: <p>The resource is temporarily unavailable to be acted upon. For example, if the resource is currently undergoing an operation and can't be acted upon until that operation is finished.</p>
601
+ capo_cloudcontrol.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource with the specified identifier can't be found.</p>
602
+ capo_cloudcontrol.errors.service_internal_error_exception.ServiceInternalErrorException: <p>The resource handler has returned that the downstream service returned an internal error, typically with a <code>5XX HTTP</code> status code.</p>
603
+ capo_cloudcontrol.errors.service_limit_exceeded_exception.ServiceLimitExceededException: <p>The resource handler has returned that a non-transient resource limit was reached on the service side.</p>
604
+ capo_cloudcontrol.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
605
+ capo_cloudcontrol.errors.type_not_found_exception.TypeNotFoundException: <p>The specified extension doesn't exist in the CloudFormation registry.</p>
606
+ capo_cloudcontrol.errors.unsupported_action_exception.UnsupportedActionException: <p>The specified resource doesn't support this resource operation.</p>
607
+ capo_cloudcontrol.errors.UnknownServiceError: The service returned an error code this client does not model.
608
+ """
609
+
610
+ async def _handler(
611
+ req: "AsyncOperationRequest[capo_cloudcontrol.types.list_resources_input.ListResourcesInput]",
612
+ ) -> AsyncOperationResponse[
613
+ "capo_cloudcontrol.types.list_resources_output.ListResourcesOutput"
614
+ ]:
615
+ import capo_cloudcontrol._operations.cloud_api_service.list_resources
616
+
617
+ (
618
+ output,
619
+ http_response,
620
+ ) = await capo_cloudcontrol._operations.cloud_api_service.list_resources.async_list_resources(
621
+ req.options, req.input
622
+ )
623
+ return AsyncOperationResponse(output=output, response=http_response)
624
+
625
+ interceptors_, options_ = self.operation_options(config_overrides)
626
+ input_: capo_cloudcontrol.types.list_resources_input.ListResourcesInput = {
627
+ "type_name": type_name
628
+ }
629
+ if type_version_id is not None:
630
+ input_["type_version_id"] = type_version_id
631
+ if role_arn is not None:
632
+ input_["role_arn"] = role_arn
633
+ if next_token is not None:
634
+ input_["next_token"] = next_token
635
+ if max_results is not None:
636
+ input_["max_results"] = max_results
637
+ if resource_model is not None:
638
+ input_["resource_model"] = resource_model
639
+
640
+ response = await aexecute_pipeline(
641
+ AsyncOperationRequest(input=input_, options=options_),
642
+ handler=_handler,
643
+ interceptors=list(interceptors_),
644
+ )
645
+ await response.response.aclose()
646
+ return response.output
647
+
648
+ async def iter_list_resources(
649
+ self,
650
+ type_name: "capo_cloudcontrol.types.type_name.TypeName",
651
+ *,
652
+ config_overrides: Optional[AsyncCloudControlClientConfig] = None,
653
+ type_version_id: Optional[
654
+ "capo_cloudcontrol.types.type_version_id.TypeVersionId"
655
+ ] = None,
656
+ role_arn: Optional["capo_cloudcontrol.types.role_arn.RoleArn"] = None,
657
+ next_token: Optional[
658
+ "capo_cloudcontrol.types.handler_next_token.HandlerNextToken"
659
+ ] = None,
660
+ max_results: Optional["capo_cloudcontrol.types.max_results.MaxResults"] = None,
661
+ resource_model: Optional[
662
+ "capo_cloudcontrol.types.properties.Properties"
663
+ ] = None,
664
+ ) -> "AsyncIterator[capo_cloudcontrol.types.resource_description.ResourceDescription]":
665
+ _token = next_token
666
+ while True:
667
+ _response = await self.list_resources(
668
+ type_name,
669
+ config_overrides=config_overrides,
670
+ type_version_id=type_version_id,
671
+ role_arn=role_arn,
672
+ next_token=_token,
673
+ max_results=max_results,
674
+ resource_model=resource_model,
675
+ )
676
+ _page = _resolve_path(_response, ("resource_descriptions",))
677
+ for _item in _page or []:
678
+ yield _item
679
+ _token = _resolve_path(_response, ("next_token",))
680
+ if not _token:
681
+ break
682
+
683
+ async def update_resource(
684
+ self,
685
+ type_name: "capo_cloudcontrol.types.type_name.TypeName",
686
+ identifier: "capo_cloudcontrol.types.identifier.Identifier",
687
+ patch_document: "capo_cloudcontrol.types.patch_document.PatchDocument",
688
+ *,
689
+ config_overrides: Optional[AsyncCloudControlClientConfig] = None,
690
+ type_version_id: Optional[
691
+ "capo_cloudcontrol.types.type_version_id.TypeVersionId"
692
+ ] = None,
693
+ role_arn: Optional["capo_cloudcontrol.types.role_arn.RoleArn"] = None,
694
+ client_token: Optional[
695
+ "capo_cloudcontrol.types.client_token.ClientToken"
696
+ ] = None,
697
+ ) -> "capo_cloudcontrol.types.update_resource_output.UpdateResourceOutput":
698
+ r"""<p>Updates the specified property values in the resource.</p> <p>You specify your resource property updates as a list of patch operations contained in a JSON patch document that adheres to the <a href=\"https://datatracker.ietf.org/doc/html/rfc6902\"> <i>RFC 6902 - JavaScript Object Notation (JSON) Patch</i> </a> standard.</p> <p>For details on how Cloud Control API performs resource update operations, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-update.html\">Updating a resource</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p> <p>After you have initiated a resource update request, you can monitor the progress of your request by calling <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html\">GetResourceRequestStatus</a> using the <code>RequestToken</code> of the <code>ProgressEvent</code> returned by <code>UpdateResource</code>.</p> <p>For more information about the properties of a specific resource, refer to the related topic for the resource in the <a href=\"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html\">Resource and property types reference</a> in the <i>CloudFormation Users Guide</i>.</p>
699
+
700
+ Args:
701
+ type_name: <p>The name of the resource type.</p>
702
+ type_version_id: <p>For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.</p>
703
+ role_arn: <p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the <code> <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers\">handlers</a> </code> section of the <a href=\"https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html\">resource type definition schema</a>.</p> <p>If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions\">Specifying credentials</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
704
+ client_token: <p>A unique identifier to ensure the idempotency of the resource request. As a best practice, specify this token to ensure idempotency, so that Amazon Web Services Cloud Control API can accurately distinguish between request retries and new resource requests. You might retry a resource request to ensure that it was successfully received.</p> <p>A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request.</p> <p>If you do not specify a client token, one is generated for inclusion in the request.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency\">Ensuring resource operation requests are unique</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
705
+ identifier: <p>The identifier for the resource.</p> <p>You can specify the primary identifier, or any secondary identifier defined for the resource type in its resource schema. You can only specify one identifier. Primary identifiers can be specified as a string or JSON; secondary identifiers must be specified as JSON.</p> <p>For compound primary identifiers (that is, one that consists of multiple resource properties strung together), to specify the primary identifier as a string, list the property values <i>in the order they are specified</i> in the primary identifier definition, separated by <code>|</code>.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html\">Identifying resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
706
+ patch_document: <p>A JavaScript Object Notation (JSON) document listing the patch operations that represent the updates to apply to the current resource properties. For details, see <a href=\"https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-update.html#resource-operations-update-patch\">Composing the patch document</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
707
+
708
+ Raises:
709
+ capo_cloudcontrol.errors.already_exists_exception.AlreadyExistsException: <p>The resource with the name requested already exists.</p>
710
+ capo_cloudcontrol.errors.client_token_conflict_exception.ClientTokenConflictException: <p>The specified client token has already been used in another resource request.</p> <p>It's best practice for client tokens to be unique for each resource operation request. However, client token expire after 36 hours.</p>
711
+ capo_cloudcontrol.errors.concurrent_operation_exception.ConcurrentOperationException: <p>Another resource operation is currently being performed on this resource.</p>
712
+ capo_cloudcontrol.errors.general_service_exception.GeneralServiceException: <p>The resource handler has returned that the downstream service generated an error that doesn't map to any other handler error code.</p>
713
+ capo_cloudcontrol.errors.handler_failure_exception.HandlerFailureException: <p>The resource handler has failed without a returning a more specific error code. This can include timeouts.</p>
714
+ capo_cloudcontrol.errors.handler_internal_failure_exception.HandlerInternalFailureException: <p>The resource handler has returned that an unexpected error occurred within the resource handler.</p>
715
+ capo_cloudcontrol.errors.invalid_credentials_exception.InvalidCredentialsException: <p>The resource handler has returned that the credentials provided by the user are invalid.</p>
716
+ capo_cloudcontrol.errors.invalid_request_exception.InvalidRequestException: <p>The resource handler has returned that invalid input from the user has generated a generic exception.</p>
717
+ capo_cloudcontrol.errors.network_failure_exception.NetworkFailureException: <p>The resource handler has returned that the request couldn't be completed due to networking issues, such as a failure to receive a response from the server.</p>
718
+ capo_cloudcontrol.errors.not_stabilized_exception.NotStabilizedException: <p>The resource handler has returned that the downstream resource failed to complete all of its ready-state checks.</p>
719
+ capo_cloudcontrol.errors.not_updatable_exception.NotUpdatableException: <p>One or more properties included in this resource operation are defined as create-only, and therefore can't be updated.</p>
720
+ capo_cloudcontrol.errors.private_type_exception.PrivateTypeException: <p>Cloud Control API hasn't received a valid response from the resource handler, due to a configuration error. This includes issues such as the resource handler returning an invalid response, or timing out.</p>
721
+ capo_cloudcontrol.errors.resource_conflict_exception.ResourceConflictException: <p>The resource is temporarily unavailable to be acted upon. For example, if the resource is currently undergoing an operation and can't be acted upon until that operation is finished.</p>
722
+ capo_cloudcontrol.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource with the specified identifier can't be found.</p>
723
+ capo_cloudcontrol.errors.service_internal_error_exception.ServiceInternalErrorException: <p>The resource handler has returned that the downstream service returned an internal error, typically with a <code>5XX HTTP</code> status code.</p>
724
+ capo_cloudcontrol.errors.service_limit_exceeded_exception.ServiceLimitExceededException: <p>The resource handler has returned that a non-transient resource limit was reached on the service side.</p>
725
+ capo_cloudcontrol.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
726
+ capo_cloudcontrol.errors.type_not_found_exception.TypeNotFoundException: <p>The specified extension doesn't exist in the CloudFormation registry.</p>
727
+ capo_cloudcontrol.errors.unsupported_action_exception.UnsupportedActionException: <p>The specified resource doesn't support this resource operation.</p>
728
+ capo_cloudcontrol.errors.UnknownServiceError: The service returned an error code this client does not model.
729
+ """
730
+
731
+ async def _handler(
732
+ req: "AsyncOperationRequest[capo_cloudcontrol.types.update_resource_input.UpdateResourceInput]",
733
+ ) -> AsyncOperationResponse[
734
+ "capo_cloudcontrol.types.update_resource_output.UpdateResourceOutput"
735
+ ]:
736
+ import capo_cloudcontrol._operations.cloud_api_service.update_resource
737
+
738
+ (
739
+ output,
740
+ http_response,
741
+ ) = await capo_cloudcontrol._operations.cloud_api_service.update_resource.async_update_resource(
742
+ req.options, req.input
743
+ )
744
+ return AsyncOperationResponse(output=output, response=http_response)
745
+
746
+ interceptors_, options_ = self.operation_options(config_overrides)
747
+ input_: capo_cloudcontrol.types.update_resource_input.UpdateResourceInput = {
748
+ "type_name": type_name,
749
+ "identifier": identifier,
750
+ "patch_document": patch_document,
751
+ }
752
+ if type_version_id is not None:
753
+ input_["type_version_id"] = type_version_id
754
+ if role_arn is not None:
755
+ input_["role_arn"] = role_arn
756
+ if client_token is None:
757
+ client_token = str(uuid.uuid4())
758
+ input_["client_token"] = client_token
759
+
760
+ response = await aexecute_pipeline(
761
+ AsyncOperationRequest(input=input_, options=options_),
762
+ handler=_handler,
763
+ interceptors=list(interceptors_),
764
+ )
765
+ await response.response.aclose()
766
+ return response.output
767
+
768
+ async def __aenter__(self) -> Self:
769
+ return self
770
+
771
+ async def __aexit__(self, exc_type: Any, exc: Any, tb: Any):
772
+ await self._client.aclose()