capo-codecatalyst 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 (233) hide show
  1. capo_codecatalyst/__init__.py +51 -0
  2. capo_codecatalyst/_async.py +25 -0
  3. capo_codecatalyst/_auth/_identity.py +14 -0
  4. capo_codecatalyst/_auth/_providers.py +154 -0
  5. capo_codecatalyst/_auth/_signers.py +43 -0
  6. capo_codecatalyst/_auth/_sigv4.py +434 -0
  7. capo_codecatalyst/_auth/_zapros_handler.py +80 -0
  8. capo_codecatalyst/_iter.py +113 -0
  9. capo_codecatalyst/_operations/code_catalyst/create_access_token.py +153 -0
  10. capo_codecatalyst/_operations/code_catalyst/create_dev_environment.py +165 -0
  11. capo_codecatalyst/_operations/code_catalyst/create_project.py +158 -0
  12. capo_codecatalyst/_operations/code_catalyst/create_source_repository.py +159 -0
  13. capo_codecatalyst/_operations/code_catalyst/create_source_repository_branch.py +165 -0
  14. capo_codecatalyst/_operations/code_catalyst/delete_access_token.py +146 -0
  15. capo_codecatalyst/_operations/code_catalyst/delete_dev_environment.py +159 -0
  16. capo_codecatalyst/_operations/code_catalyst/delete_project.py +155 -0
  17. capo_codecatalyst/_operations/code_catalyst/delete_source_repository.py +155 -0
  18. capo_codecatalyst/_operations/code_catalyst/delete_space.py +152 -0
  19. capo_codecatalyst/_operations/code_catalyst/get_dev_environment.py +159 -0
  20. capo_codecatalyst/_operations/code_catalyst/get_project.py +153 -0
  21. capo_codecatalyst/_operations/code_catalyst/get_source_repository.py +156 -0
  22. capo_codecatalyst/_operations/code_catalyst/get_source_repository_clone_urls.py +157 -0
  23. capo_codecatalyst/_operations/code_catalyst/get_space.py +152 -0
  24. capo_codecatalyst/_operations/code_catalyst/get_subscription.py +155 -0
  25. capo_codecatalyst/_operations/code_catalyst/get_user_details.py +157 -0
  26. capo_codecatalyst/_operations/code_catalyst/get_workflow.py +159 -0
  27. capo_codecatalyst/_operations/code_catalyst/get_workflow_run.py +161 -0
  28. capo_codecatalyst/_operations/code_catalyst/list_access_tokens.py +153 -0
  29. capo_codecatalyst/_operations/code_catalyst/list_dev_environment_sessions.py +164 -0
  30. capo_codecatalyst/_operations/code_catalyst/list_dev_environments.py +156 -0
  31. capo_codecatalyst/_operations/code_catalyst/list_event_logs.py +160 -0
  32. capo_codecatalyst/_operations/code_catalyst/list_projects.py +158 -0
  33. capo_codecatalyst/_operations/code_catalyst/list_source_repositories.py +159 -0
  34. capo_codecatalyst/_operations/code_catalyst/list_source_repository_branches.py +164 -0
  35. capo_codecatalyst/_operations/code_catalyst/list_spaces.py +155 -0
  36. capo_codecatalyst/_operations/code_catalyst/list_workflow_runs.py +166 -0
  37. capo_codecatalyst/_operations/code_catalyst/list_workflows.py +168 -0
  38. capo_codecatalyst/_operations/code_catalyst/start_dev_environment.py +160 -0
  39. capo_codecatalyst/_operations/code_catalyst/start_dev_environment_session.py +163 -0
  40. capo_codecatalyst/_operations/code_catalyst/start_workflow_run.py +160 -0
  41. capo_codecatalyst/_operations/code_catalyst/stop_dev_environment.py +155 -0
  42. capo_codecatalyst/_operations/code_catalyst/stop_dev_environment_session.py +156 -0
  43. capo_codecatalyst/_operations/code_catalyst/update_dev_environment.py +164 -0
  44. capo_codecatalyst/_operations/code_catalyst/update_project.py +159 -0
  45. capo_codecatalyst/_operations/code_catalyst/update_space.py +156 -0
  46. capo_codecatalyst/_operations/code_catalyst/verify_session.py +146 -0
  47. capo_codecatalyst/_pagination.py +21 -0
  48. capo_codecatalyst/_protocol/__init__.py +1 -0
  49. capo_codecatalyst/_protocol/errors.py +93 -0
  50. capo_codecatalyst/_protocol/eventstream.py +238 -0
  51. capo_codecatalyst/_protocol/serialize.py +47 -0
  52. capo_codecatalyst/_protocol/xml.py +33 -0
  53. capo_codecatalyst/_resources/code_catalyst/access_token.py +359 -0
  54. capo_codecatalyst/_resources/code_catalyst/space.py +578 -0
  55. capo_codecatalyst/_rule_engine/__init__.py +0 -0
  56. capo_codecatalyst/_rule_engine/_aws_partition.py +160 -0
  57. capo_codecatalyst/_rule_engine/_endpoint_rule_set.py +98 -0
  58. capo_codecatalyst/_rule_engine/_endpoint_runtime.py +389 -0
  59. capo_codecatalyst/_services/_aws_config.py +156 -0
  60. capo_codecatalyst/_services/_pipeline.py +195 -0
  61. capo_codecatalyst/_services/async_code_catalyst.py +214 -0
  62. capo_codecatalyst/_services/code_catalyst.py +212 -0
  63. capo_codecatalyst/errors/__init__.py +33 -0
  64. capo_codecatalyst/errors/_base.py +94 -0
  65. capo_codecatalyst/errors/access_denied_exception.py +47 -0
  66. capo_codecatalyst/errors/conflict_exception.py +45 -0
  67. capo_codecatalyst/errors/resource_not_found_exception.py +47 -0
  68. capo_codecatalyst/errors/service_quota_exceeded_exception.py +49 -0
  69. capo_codecatalyst/errors/throttling_exception.py +45 -0
  70. capo_codecatalyst/errors/validation_exception.py +45 -0
  71. capo_codecatalyst/py.typed +0 -0
  72. capo_codecatalyst/types/_prelude/blob.py +12 -0
  73. capo_codecatalyst/types/_prelude/timestamp.py +17 -0
  74. capo_codecatalyst/types/access_token_id.py +5 -0
  75. capo_codecatalyst/types/access_token_name.py +5 -0
  76. capo_codecatalyst/types/access_token_secret.py +5 -0
  77. capo_codecatalyst/types/access_token_summaries.py +31 -0
  78. capo_codecatalyst/types/access_token_summary.py +54 -0
  79. capo_codecatalyst/types/client_token.py +5 -0
  80. capo_codecatalyst/types/comparison_operator.py +5 -0
  81. capo_codecatalyst/types/create_access_token_request.py +46 -0
  82. capo_codecatalyst/types/create_access_token_response.py +63 -0
  83. capo_codecatalyst/types/create_dev_environment_request.py +123 -0
  84. capo_codecatalyst/types/create_dev_environment_response.py +52 -0
  85. capo_codecatalyst/types/create_project_request.py +43 -0
  86. capo_codecatalyst/types/create_project_response.py +49 -0
  87. capo_codecatalyst/types/create_source_repository_branch_request.py +38 -0
  88. capo_codecatalyst/types/create_source_repository_branch_response.py +60 -0
  89. capo_codecatalyst/types/create_source_repository_request.py +38 -0
  90. capo_codecatalyst/types/create_source_repository_response.py +57 -0
  91. capo_codecatalyst/types/delete_access_token_request.py +24 -0
  92. capo_codecatalyst/types/delete_access_token_response.py +18 -0
  93. capo_codecatalyst/types/delete_dev_environment_request.py +29 -0
  94. capo_codecatalyst/types/delete_dev_environment_response.py +46 -0
  95. capo_codecatalyst/types/delete_project_request.py +26 -0
  96. capo_codecatalyst/types/delete_project_response.py +44 -0
  97. capo_codecatalyst/types/delete_source_repository_request.py +29 -0
  98. capo_codecatalyst/types/delete_source_repository_response.py +48 -0
  99. capo_codecatalyst/types/delete_space_request.py +24 -0
  100. capo_codecatalyst/types/delete_space_response.py +37 -0
  101. capo_codecatalyst/types/dev_environment_access_details.py +38 -0
  102. capo_codecatalyst/types/dev_environment_repository_summaries.py +39 -0
  103. capo_codecatalyst/types/dev_environment_repository_summary.py +42 -0
  104. capo_codecatalyst/types/dev_environment_session_configuration.py +56 -0
  105. capo_codecatalyst/types/dev_environment_session_summary.py +71 -0
  106. capo_codecatalyst/types/dev_environment_session_type.py +5 -0
  107. capo_codecatalyst/types/dev_environment_sessions_summary_list.py +37 -0
  108. capo_codecatalyst/types/dev_environment_status.py +5 -0
  109. capo_codecatalyst/types/dev_environment_summary.py +163 -0
  110. capo_codecatalyst/types/dev_environment_summary_list.py +33 -0
  111. capo_codecatalyst/types/email_address.py +29 -0
  112. capo_codecatalyst/types/event_log_entries.py +31 -0
  113. capo_codecatalyst/types/event_log_entry.py +174 -0
  114. capo_codecatalyst/types/event_payload.py +29 -0
  115. capo_codecatalyst/types/execute_command_session_configuration.py +53 -0
  116. capo_codecatalyst/types/execute_command_session_configuration_arguments.py +14 -0
  117. capo_codecatalyst/types/filter.py +50 -0
  118. capo_codecatalyst/types/filter_key.py +5 -0
  119. capo_codecatalyst/types/filters.py +29 -0
  120. capo_codecatalyst/types/get_dev_environment_request.py +29 -0
  121. capo_codecatalyst/types/get_dev_environment_response.py +169 -0
  122. capo_codecatalyst/types/get_project_request.py +26 -0
  123. capo_codecatalyst/types/get_project_response.py +49 -0
  124. capo_codecatalyst/types/get_source_repository_clone_urls_request.py +29 -0
  125. capo_codecatalyst/types/get_source_repository_clone_urls_response.py +28 -0
  126. capo_codecatalyst/types/get_source_repository_request.py +29 -0
  127. capo_codecatalyst/types/get_source_repository_response.py +88 -0
  128. capo_codecatalyst/types/get_space_request.py +24 -0
  129. capo_codecatalyst/types/get_space_response.py +51 -0
  130. capo_codecatalyst/types/get_subscription_request.py +24 -0
  131. capo_codecatalyst/types/get_subscription_response.py +59 -0
  132. capo_codecatalyst/types/get_user_details_request.py +21 -0
  133. capo_codecatalyst/types/get_user_details_response.py +60 -0
  134. capo_codecatalyst/types/get_workflow_request.py +29 -0
  135. capo_codecatalyst/types/get_workflow_response.py +136 -0
  136. capo_codecatalyst/types/get_workflow_run_request.py +29 -0
  137. capo_codecatalyst/types/get_workflow_run_response.py +127 -0
  138. capo_codecatalyst/types/ide.py +29 -0
  139. capo_codecatalyst/types/ide_configuration.py +29 -0
  140. capo_codecatalyst/types/ide_configuration_list.py +31 -0
  141. capo_codecatalyst/types/ides.py +29 -0
  142. capo_codecatalyst/types/inactivity_timeout_minutes.py +5 -0
  143. capo_codecatalyst/types/instance_type.py +5 -0
  144. capo_codecatalyst/types/list_access_tokens_request.py +29 -0
  145. capo_codecatalyst/types/list_access_tokens_response.py +45 -0
  146. capo_codecatalyst/types/list_dev_environment_sessions_request.py +41 -0
  147. capo_codecatalyst/types/list_dev_environment_sessions_response.py +49 -0
  148. capo_codecatalyst/types/list_dev_environments_request.py +57 -0
  149. capo_codecatalyst/types/list_dev_environments_response.py +49 -0
  150. capo_codecatalyst/types/list_event_logs_request.py +75 -0
  151. capo_codecatalyst/types/list_event_logs_response.py +45 -0
  152. capo_codecatalyst/types/list_projects_request.py +53 -0
  153. capo_codecatalyst/types/list_projects_response.py +42 -0
  154. capo_codecatalyst/types/list_source_repositories_item.py +81 -0
  155. capo_codecatalyst/types/list_source_repositories_items.py +35 -0
  156. capo_codecatalyst/types/list_source_repositories_request.py +38 -0
  157. capo_codecatalyst/types/list_source_repositories_response.py +48 -0
  158. capo_codecatalyst/types/list_source_repository_branches_item.py +60 -0
  159. capo_codecatalyst/types/list_source_repository_branches_items.py +39 -0
  160. capo_codecatalyst/types/list_source_repository_branches_request.py +41 -0
  161. capo_codecatalyst/types/list_source_repository_branches_response.py +51 -0
  162. capo_codecatalyst/types/list_spaces_request.py +23 -0
  163. capo_codecatalyst/types/list_spaces_response.py +42 -0
  164. capo_codecatalyst/types/list_workflow_runs_request.py +54 -0
  165. capo_codecatalyst/types/list_workflow_runs_response.py +44 -0
  166. capo_codecatalyst/types/list_workflows_request.py +51 -0
  167. capo_codecatalyst/types/list_workflows_response.py +42 -0
  168. capo_codecatalyst/types/name_string.py +5 -0
  169. capo_codecatalyst/types/operation_type.py +5 -0
  170. capo_codecatalyst/types/persistent_storage.py +26 -0
  171. capo_codecatalyst/types/persistent_storage_configuration.py +28 -0
  172. capo_codecatalyst/types/project_description.py +5 -0
  173. capo_codecatalyst/types/project_display_name.py +5 -0
  174. capo_codecatalyst/types/project_information.py +29 -0
  175. capo_codecatalyst/types/project_list_filter.py +54 -0
  176. capo_codecatalyst/types/project_list_filters.py +31 -0
  177. capo_codecatalyst/types/project_summaries.py +31 -0
  178. capo_codecatalyst/types/project_summary.py +38 -0
  179. capo_codecatalyst/types/region_string.py +5 -0
  180. capo_codecatalyst/types/repositories_input.py +31 -0
  181. capo_codecatalyst/types/repository_input.py +40 -0
  182. capo_codecatalyst/types/sensitive_string.py +5 -0
  183. capo_codecatalyst/types/source_repository_branch_ref_string.py +5 -0
  184. capo_codecatalyst/types/source_repository_branch_string.py +5 -0
  185. capo_codecatalyst/types/source_repository_description_string.py +5 -0
  186. capo_codecatalyst/types/source_repository_id_string.py +5 -0
  187. capo_codecatalyst/types/source_repository_name_string.py +5 -0
  188. capo_codecatalyst/types/space_description.py +5 -0
  189. capo_codecatalyst/types/space_summaries.py +29 -0
  190. capo_codecatalyst/types/space_summary.py +51 -0
  191. capo_codecatalyst/types/start_dev_environment_request.py +63 -0
  192. capo_codecatalyst/types/start_dev_environment_response.py +54 -0
  193. capo_codecatalyst/types/start_dev_environment_session_request.py +52 -0
  194. capo_codecatalyst/types/start_dev_environment_session_response.py +77 -0
  195. capo_codecatalyst/types/start_workflow_run_request.py +35 -0
  196. capo_codecatalyst/types/start_workflow_run_response.py +53 -0
  197. capo_codecatalyst/types/status_reason.py +5 -0
  198. capo_codecatalyst/types/stop_dev_environment_request.py +29 -0
  199. capo_codecatalyst/types/stop_dev_environment_response.py +54 -0
  200. capo_codecatalyst/types/stop_dev_environment_session_request.py +31 -0
  201. capo_codecatalyst/types/stop_dev_environment_session_response.py +59 -0
  202. capo_codecatalyst/types/string_list.py +14 -0
  203. capo_codecatalyst/types/timestamp.py +20 -0
  204. capo_codecatalyst/types/update_dev_environment_request.py +76 -0
  205. capo_codecatalyst/types/update_dev_environment_response.py +93 -0
  206. capo_codecatalyst/types/update_project_request.py +35 -0
  207. capo_codecatalyst/types/update_project_response.py +46 -0
  208. capo_codecatalyst/types/update_space_request.py +33 -0
  209. capo_codecatalyst/types/update_space_response.py +40 -0
  210. capo_codecatalyst/types/user_identity.py +50 -0
  211. capo_codecatalyst/types/user_type.py +5 -0
  212. capo_codecatalyst/types/uuid.py +5 -0
  213. capo_codecatalyst/types/verify_session_response.py +23 -0
  214. capo_codecatalyst/types/workflow_definition.py +26 -0
  215. capo_codecatalyst/types/workflow_definition_summary.py +26 -0
  216. capo_codecatalyst/types/workflow_run_mode.py +5 -0
  217. capo_codecatalyst/types/workflow_run_sort_criteria.py +18 -0
  218. capo_codecatalyst/types/workflow_run_sort_criteria_list.py +35 -0
  219. capo_codecatalyst/types/workflow_run_status.py +5 -0
  220. capo_codecatalyst/types/workflow_run_status_reason.py +18 -0
  221. capo_codecatalyst/types/workflow_run_status_reasons.py +35 -0
  222. capo_codecatalyst/types/workflow_run_summaries.py +31 -0
  223. capo_codecatalyst/types/workflow_run_summary.py +119 -0
  224. capo_codecatalyst/types/workflow_sort_criteria.py +18 -0
  225. capo_codecatalyst/types/workflow_sort_criteria_list.py +33 -0
  226. capo_codecatalyst/types/workflow_status.py +5 -0
  227. capo_codecatalyst/types/workflow_summaries.py +31 -0
  228. capo_codecatalyst/types/workflow_summary.py +123 -0
  229. capo_codecatalyst-0.1.0.dist-info/METADATA +82 -0
  230. capo_codecatalyst-0.1.0.dist-info/RECORD +233 -0
  231. capo_codecatalyst-0.1.0.dist-info/WHEEL +5 -0
  232. capo_codecatalyst-0.1.0.dist-info/licenses/LICENSE +21 -0
  233. capo_codecatalyst-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,47 @@
1
+ """Shared request-binding serialization runtime.
2
+
3
+ Hand-written, not regenerated. Text encodings for values bound to HTTP
4
+ labels, query parameters, and headers by the generated operations.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import base64
10
+ import datetime
11
+ from email.utils import format_datetime
12
+
13
+
14
+ def as_utc(value: datetime.datetime) -> datetime.datetime:
15
+ """Normalize to an aware UTC datetime; naive values are taken as UTC."""
16
+ if value.tzinfo is None:
17
+ return value.replace(tzinfo=datetime.timezone.utc)
18
+ return value.astimezone(datetime.timezone.utc)
19
+
20
+
21
+ def fmt_date_time(value: datetime.datetime) -> str:
22
+ """RFC 3339 with a ``Z`` designator, e.g. ``2015-01-25T08:00:00Z``."""
23
+ return as_utc(value).isoformat().replace("+00:00", "Z")
24
+
25
+
26
+ def fmt_http_date(value: datetime.datetime) -> str:
27
+ """IMF-fixdate, e.g. ``Sun, 25 Jan 2015 08:00:00 GMT``."""
28
+ return format_datetime(as_utc(value), usegmt=True)
29
+
30
+
31
+ def fmt_epoch_seconds(value: datetime.datetime) -> str:
32
+ """Seconds since the epoch; whole seconds carry no ``.0`` suffix."""
33
+ ts = as_utc(value).timestamp()
34
+ return str(int(ts)) if ts == int(ts) else str(ts)
35
+
36
+
37
+ def b64(value: bytes) -> str:
38
+ return base64.b64encode(value).decode("ascii")
39
+
40
+
41
+ __all__ = [
42
+ "as_utc",
43
+ "b64",
44
+ "fmt_date_time",
45
+ "fmt_epoch_seconds",
46
+ "fmt_http_date",
47
+ ]
@@ -0,0 +1,33 @@
1
+ """Shared XML protocol runtime.
2
+
3
+ Hand-written, not regenerated. Holds re-exports of
4
+ ``xml.etree.ElementTree`` primitives generated code depends on.
5
+ """
6
+
7
+ from xml.etree.ElementTree import Element, SubElement, tostring
8
+ from xml.etree.ElementTree import fromstring as _fromstring
9
+
10
+
11
+ def fromstring(text: str | bytes) -> Element:
12
+ """Parse XML and strip namespaces so generated ``el.find("Tag")`` and
13
+ ``el.get("attr")`` lookups match. AWS restXml responses use a default
14
+ namespace which ElementTree otherwise qualifies onto every tag as
15
+ ``{ns}Tag``; prefixed attributes (e.g. ``xsi:type``) get the same
16
+ treatment on their keys."""
17
+ root = _fromstring(text)
18
+ for el in root.iter():
19
+ if el.tag.startswith("{"):
20
+ el.tag = el.tag.rpartition("}")[2]
21
+ if any(key.startswith("{") for key in el.attrib):
22
+ el.attrib = {
23
+ key.rpartition("}")[2]: value for key, value in el.attrib.items()
24
+ }
25
+ return root
26
+
27
+
28
+ __all__ = [
29
+ "Element",
30
+ "SubElement",
31
+ "fromstring",
32
+ "tostring",
33
+ ]
@@ -0,0 +1,359 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Optional
4
+
5
+ import capo_codecatalyst._auth._signers
6
+ import capo_codecatalyst._auth._sigv4
7
+ from capo_codecatalyst._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_codecatalyst.types.access_token_id
18
+ import capo_codecatalyst.types.access_token_name
19
+ import capo_codecatalyst.types.access_token_summary
20
+ import capo_codecatalyst.types.create_access_token_request
21
+ import capo_codecatalyst.types.create_access_token_response
22
+ import capo_codecatalyst.types.delete_access_token_request
23
+ import capo_codecatalyst.types.delete_access_token_response
24
+ import capo_codecatalyst.types.list_access_tokens_request
25
+ import capo_codecatalyst.types.list_access_tokens_response
26
+ import capo_codecatalyst.types.timestamp
27
+ from capo_codecatalyst._services.async_code_catalyst import (
28
+ AsyncCodeCatalystClient,
29
+ AsyncCodeCatalystClientConfig,
30
+ )
31
+ from capo_codecatalyst._services.code_catalyst import (
32
+ CodeCatalystClient,
33
+ CodeCatalystClientConfig,
34
+ )
35
+
36
+
37
+ class AccessToken:
38
+ def __init__(self, service: CodeCatalystClient) -> None:
39
+ self._service = service
40
+
41
+ def create(
42
+ self,
43
+ name: "capo_codecatalyst.types.access_token_name.AccessTokenName",
44
+ *,
45
+ config_overrides: Optional[CodeCatalystClientConfig] = None,
46
+ expires_time: Optional["capo_codecatalyst.types.timestamp.Timestamp"] = None,
47
+ ) -> (
48
+ "capo_codecatalyst.types.create_access_token_response.CreateAccessTokenResponse"
49
+ ):
50
+ r"""<p>Creates a personal access token (PAT) for the current user. A personal access token (PAT) is similar to a password. It is associated with your user identity for use across all spaces and projects in Amazon CodeCatalyst. You use PATs to access CodeCatalyst from resources that include integrated development environments (IDEs) and Git-based source repositories. PATs represent you in Amazon CodeCatalyst and you can manage them in your user settings.For more information, see <a href=\"https://docs.aws.amazon.com/codecatalyst/latest/userguide/ipa-tokens-keys.html\">Managing personal access tokens in Amazon CodeCatalyst</a>.</p>
51
+
52
+ Args:
53
+ name: <p>The friendly name of the personal access token.</p>
54
+ expires_time: <p>The date and time the personal access token expires, in coordinated universal time (UTC) timestamp format as specified in <a href=\"https://www.rfc-editor.org/rfc/rfc3339#section-5.6\">RFC 3339</a>.</p>
55
+
56
+ Raises:
57
+ capo_codecatalyst.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.</p>
58
+ capo_codecatalyst.errors.conflict_exception.ConflictException: <p>The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.</p>
59
+ capo_codecatalyst.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.</p>
60
+ capo_codecatalyst.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.</p>
61
+ capo_codecatalyst.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
62
+ capo_codecatalyst.errors.validation_exception.ValidationException: <p>The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.</p>
63
+ capo_codecatalyst.errors.UnknownServiceError: The service returned an error code this client does not model.
64
+ """
65
+
66
+ def _handler(
67
+ req: "OperationRequest[capo_codecatalyst.types.create_access_token_request.CreateAccessTokenRequest]",
68
+ ) -> OperationResponse[
69
+ "capo_codecatalyst.types.create_access_token_response.CreateAccessTokenResponse"
70
+ ]:
71
+ import capo_codecatalyst._operations.code_catalyst.create_access_token
72
+
73
+ output, http_response = (
74
+ capo_codecatalyst._operations.code_catalyst.create_access_token.create_access_token(
75
+ req.options, req.input
76
+ )
77
+ )
78
+ return OperationResponse(output=output, response=http_response)
79
+
80
+ interceptors_, options_ = self._service.operation_options(config_overrides)
81
+ input_: capo_codecatalyst.types.create_access_token_request.CreateAccessTokenRequest = {
82
+ "name": name
83
+ }
84
+ if expires_time is not None:
85
+ input_["expires_time"] = expires_time
86
+
87
+ response = execute_pipeline(
88
+ OperationRequest(input=input_, options=options_),
89
+ handler=_handler,
90
+ interceptors=list(interceptors_),
91
+ )
92
+ response.response.close()
93
+ return response.output
94
+
95
+ def delete(
96
+ self,
97
+ id: "capo_codecatalyst.types.access_token_id.AccessTokenId",
98
+ *,
99
+ config_overrides: Optional[CodeCatalystClientConfig] = None,
100
+ ) -> (
101
+ "capo_codecatalyst.types.delete_access_token_response.DeleteAccessTokenResponse"
102
+ ):
103
+ """<p>Deletes a specified personal access token (PAT). A personal access token can only be deleted by the user who created it.</p>
104
+
105
+ Args:
106
+ id: <p>The ID of the personal access token to delete. You can find the IDs of all PATs associated with your Amazon Web Services Builder ID in a space by calling <a>ListAccessTokens</a>.</p>
107
+
108
+ Raises:
109
+ capo_codecatalyst.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.</p>
110
+ capo_codecatalyst.errors.conflict_exception.ConflictException: <p>The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.</p>
111
+ capo_codecatalyst.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.</p>
112
+ capo_codecatalyst.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.</p>
113
+ capo_codecatalyst.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
114
+ capo_codecatalyst.errors.validation_exception.ValidationException: <p>The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.</p>
115
+ capo_codecatalyst.errors.UnknownServiceError: The service returned an error code this client does not model.
116
+ """
117
+
118
+ def _handler(
119
+ req: "OperationRequest[capo_codecatalyst.types.delete_access_token_request.DeleteAccessTokenRequest]",
120
+ ) -> OperationResponse[
121
+ "capo_codecatalyst.types.delete_access_token_response.DeleteAccessTokenResponse"
122
+ ]:
123
+ import capo_codecatalyst._operations.code_catalyst.delete_access_token
124
+
125
+ output, http_response = (
126
+ capo_codecatalyst._operations.code_catalyst.delete_access_token.delete_access_token(
127
+ req.options, req.input
128
+ )
129
+ )
130
+ return OperationResponse(output=output, response=http_response)
131
+
132
+ interceptors_, options_ = self._service.operation_options(config_overrides)
133
+ input_: capo_codecatalyst.types.delete_access_token_request.DeleteAccessTokenRequest = {
134
+ "id": id
135
+ }
136
+
137
+ response = execute_pipeline(
138
+ OperationRequest(input=input_, options=options_),
139
+ handler=_handler,
140
+ interceptors=list(interceptors_),
141
+ )
142
+ response.response.close()
143
+ return response.output
144
+
145
+ def list(
146
+ self,
147
+ *,
148
+ config_overrides: Optional[CodeCatalystClientConfig] = None,
149
+ max_results: Optional[int] = None,
150
+ next_token: Optional[str] = None,
151
+ ) -> "capo_codecatalyst.types.list_access_tokens_response.ListAccessTokensResponse":
152
+ """<p>Lists all personal access tokens (PATs) associated with the user who calls the API. You can only list PATs associated with your Amazon Web Services Builder ID.</p>
153
+
154
+ Args:
155
+ max_results: <p>The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a <code>NextToken</code> element, which you can use to obtain additional results.</p>
156
+ next_token: <p>A token returned from a call to this API to indicate the next batch of results to return, if any.</p>
157
+
158
+ Raises:
159
+ capo_codecatalyst.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.</p>
160
+ capo_codecatalyst.errors.conflict_exception.ConflictException: <p>The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.</p>
161
+ capo_codecatalyst.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.</p>
162
+ capo_codecatalyst.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.</p>
163
+ capo_codecatalyst.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
164
+ capo_codecatalyst.errors.validation_exception.ValidationException: <p>The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.</p>
165
+ capo_codecatalyst.errors.UnknownServiceError: The service returned an error code this client does not model.
166
+ """
167
+
168
+ def _handler(
169
+ req: "OperationRequest[capo_codecatalyst.types.list_access_tokens_request.ListAccessTokensRequest]",
170
+ ) -> OperationResponse[
171
+ "capo_codecatalyst.types.list_access_tokens_response.ListAccessTokensResponse"
172
+ ]:
173
+ import capo_codecatalyst._operations.code_catalyst.list_access_tokens
174
+
175
+ output, http_response = (
176
+ capo_codecatalyst._operations.code_catalyst.list_access_tokens.list_access_tokens(
177
+ req.options, req.input
178
+ )
179
+ )
180
+ return OperationResponse(output=output, response=http_response)
181
+
182
+ interceptors_, options_ = self._service.operation_options(config_overrides)
183
+ input_: capo_codecatalyst.types.list_access_tokens_request.ListAccessTokensRequest = {}
184
+ if max_results is not None:
185
+ input_["max_results"] = max_results
186
+ if next_token is not None:
187
+ input_["next_token"] = next_token
188
+
189
+ response = execute_pipeline(
190
+ OperationRequest(input=input_, options=options_),
191
+ handler=_handler,
192
+ interceptors=list(interceptors_),
193
+ )
194
+ response.response.close()
195
+ return response.output
196
+
197
+
198
+ class AsyncAccessToken:
199
+ def __init__(self, service: AsyncCodeCatalystClient) -> None:
200
+ self._service = service
201
+
202
+ async def create(
203
+ self,
204
+ name: "capo_codecatalyst.types.access_token_name.AccessTokenName",
205
+ *,
206
+ config_overrides: Optional[AsyncCodeCatalystClientConfig] = None,
207
+ expires_time: Optional["capo_codecatalyst.types.timestamp.Timestamp"] = None,
208
+ ) -> (
209
+ "capo_codecatalyst.types.create_access_token_response.CreateAccessTokenResponse"
210
+ ):
211
+ r"""<p>Creates a personal access token (PAT) for the current user. A personal access token (PAT) is similar to a password. It is associated with your user identity for use across all spaces and projects in Amazon CodeCatalyst. You use PATs to access CodeCatalyst from resources that include integrated development environments (IDEs) and Git-based source repositories. PATs represent you in Amazon CodeCatalyst and you can manage them in your user settings.For more information, see <a href=\"https://docs.aws.amazon.com/codecatalyst/latest/userguide/ipa-tokens-keys.html\">Managing personal access tokens in Amazon CodeCatalyst</a>.</p>
212
+
213
+ Args:
214
+ name: <p>The friendly name of the personal access token.</p>
215
+ expires_time: <p>The date and time the personal access token expires, in coordinated universal time (UTC) timestamp format as specified in <a href=\"https://www.rfc-editor.org/rfc/rfc3339#section-5.6\">RFC 3339</a>.</p>
216
+
217
+ Raises:
218
+ capo_codecatalyst.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.</p>
219
+ capo_codecatalyst.errors.conflict_exception.ConflictException: <p>The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.</p>
220
+ capo_codecatalyst.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.</p>
221
+ capo_codecatalyst.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.</p>
222
+ capo_codecatalyst.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
223
+ capo_codecatalyst.errors.validation_exception.ValidationException: <p>The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.</p>
224
+ capo_codecatalyst.errors.UnknownServiceError: The service returned an error code this client does not model.
225
+ """
226
+
227
+ async def _handler(
228
+ req: "AsyncOperationRequest[capo_codecatalyst.types.create_access_token_request.CreateAccessTokenRequest]",
229
+ ) -> AsyncOperationResponse[
230
+ "capo_codecatalyst.types.create_access_token_response.CreateAccessTokenResponse"
231
+ ]:
232
+ import capo_codecatalyst._operations.code_catalyst.create_access_token
233
+
234
+ (
235
+ output,
236
+ http_response,
237
+ ) = await capo_codecatalyst._operations.code_catalyst.create_access_token.async_create_access_token(
238
+ req.options, req.input
239
+ )
240
+ return AsyncOperationResponse(output=output, response=http_response)
241
+
242
+ interceptors_, options_ = self._service.operation_options(config_overrides)
243
+ input_: capo_codecatalyst.types.create_access_token_request.CreateAccessTokenRequest = {
244
+ "name": name
245
+ }
246
+ if expires_time is not None:
247
+ input_["expires_time"] = expires_time
248
+
249
+ response = await aexecute_pipeline(
250
+ AsyncOperationRequest(input=input_, options=options_),
251
+ handler=_handler,
252
+ interceptors=list(interceptors_),
253
+ )
254
+ await response.response.aclose()
255
+ return response.output
256
+
257
+ async def delete(
258
+ self,
259
+ id: "capo_codecatalyst.types.access_token_id.AccessTokenId",
260
+ *,
261
+ config_overrides: Optional[AsyncCodeCatalystClientConfig] = None,
262
+ ) -> (
263
+ "capo_codecatalyst.types.delete_access_token_response.DeleteAccessTokenResponse"
264
+ ):
265
+ """<p>Deletes a specified personal access token (PAT). A personal access token can only be deleted by the user who created it.</p>
266
+
267
+ Args:
268
+ id: <p>The ID of the personal access token to delete. You can find the IDs of all PATs associated with your Amazon Web Services Builder ID in a space by calling <a>ListAccessTokens</a>.</p>
269
+
270
+ Raises:
271
+ capo_codecatalyst.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.</p>
272
+ capo_codecatalyst.errors.conflict_exception.ConflictException: <p>The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.</p>
273
+ capo_codecatalyst.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.</p>
274
+ capo_codecatalyst.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.</p>
275
+ capo_codecatalyst.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
276
+ capo_codecatalyst.errors.validation_exception.ValidationException: <p>The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.</p>
277
+ capo_codecatalyst.errors.UnknownServiceError: The service returned an error code this client does not model.
278
+ """
279
+
280
+ async def _handler(
281
+ req: "AsyncOperationRequest[capo_codecatalyst.types.delete_access_token_request.DeleteAccessTokenRequest]",
282
+ ) -> AsyncOperationResponse[
283
+ "capo_codecatalyst.types.delete_access_token_response.DeleteAccessTokenResponse"
284
+ ]:
285
+ import capo_codecatalyst._operations.code_catalyst.delete_access_token
286
+
287
+ (
288
+ output,
289
+ http_response,
290
+ ) = await capo_codecatalyst._operations.code_catalyst.delete_access_token.async_delete_access_token(
291
+ req.options, req.input
292
+ )
293
+ return AsyncOperationResponse(output=output, response=http_response)
294
+
295
+ interceptors_, options_ = self._service.operation_options(config_overrides)
296
+ input_: capo_codecatalyst.types.delete_access_token_request.DeleteAccessTokenRequest = {
297
+ "id": id
298
+ }
299
+
300
+ response = await aexecute_pipeline(
301
+ AsyncOperationRequest(input=input_, options=options_),
302
+ handler=_handler,
303
+ interceptors=list(interceptors_),
304
+ )
305
+ await response.response.aclose()
306
+ return response.output
307
+
308
+ async def list(
309
+ self,
310
+ *,
311
+ config_overrides: Optional[AsyncCodeCatalystClientConfig] = None,
312
+ max_results: Optional[int] = None,
313
+ next_token: Optional[str] = None,
314
+ ) -> "capo_codecatalyst.types.list_access_tokens_response.ListAccessTokensResponse":
315
+ """<p>Lists all personal access tokens (PATs) associated with the user who calls the API. You can only list PATs associated with your Amazon Web Services Builder ID.</p>
316
+
317
+ Args:
318
+ max_results: <p>The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a <code>NextToken</code> element, which you can use to obtain additional results.</p>
319
+ next_token: <p>A token returned from a call to this API to indicate the next batch of results to return, if any.</p>
320
+
321
+ Raises:
322
+ capo_codecatalyst.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.</p>
323
+ capo_codecatalyst.errors.conflict_exception.ConflictException: <p>The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.</p>
324
+ capo_codecatalyst.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.</p>
325
+ capo_codecatalyst.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.</p>
326
+ capo_codecatalyst.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
327
+ capo_codecatalyst.errors.validation_exception.ValidationException: <p>The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.</p>
328
+ capo_codecatalyst.errors.UnknownServiceError: The service returned an error code this client does not model.
329
+ """
330
+
331
+ async def _handler(
332
+ req: "AsyncOperationRequest[capo_codecatalyst.types.list_access_tokens_request.ListAccessTokensRequest]",
333
+ ) -> AsyncOperationResponse[
334
+ "capo_codecatalyst.types.list_access_tokens_response.ListAccessTokensResponse"
335
+ ]:
336
+ import capo_codecatalyst._operations.code_catalyst.list_access_tokens
337
+
338
+ (
339
+ output,
340
+ http_response,
341
+ ) = await capo_codecatalyst._operations.code_catalyst.list_access_tokens.async_list_access_tokens(
342
+ req.options, req.input
343
+ )
344
+ return AsyncOperationResponse(output=output, response=http_response)
345
+
346
+ interceptors_, options_ = self._service.operation_options(config_overrides)
347
+ input_: capo_codecatalyst.types.list_access_tokens_request.ListAccessTokensRequest = {}
348
+ if max_results is not None:
349
+ input_["max_results"] = max_results
350
+ if next_token is not None:
351
+ input_["next_token"] = next_token
352
+
353
+ response = await aexecute_pipeline(
354
+ AsyncOperationRequest(input=input_, options=options_),
355
+ handler=_handler,
356
+ interceptors=list(interceptors_),
357
+ )
358
+ await response.response.aclose()
359
+ return response.output