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,212 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codecatalyst#CodeCatalyst``."""
2
+
3
+ import warnings
4
+ from typing import TYPE_CHECKING, Any, Iterable, Optional
5
+
6
+ from typing_extensions import Self, TypedDict
7
+ from zapros import BaseHandler, Client
8
+
9
+ import capo_codecatalyst._auth._signers
10
+ import capo_codecatalyst._auth._sigv4
11
+ from capo_codecatalyst._auth._providers import (
12
+ BearerTokenProvider,
13
+ StaticBearerTokenProvider,
14
+ )
15
+ from capo_codecatalyst._auth._zapros_handler import AuthMiddleware
16
+ from capo_codecatalyst._resources.code_catalyst.access_token import AccessToken
17
+ from capo_codecatalyst._resources.code_catalyst.space import Space
18
+ from capo_codecatalyst._services._aws_config import aws_config
19
+ from capo_codecatalyst._services._pipeline import (
20
+ Interceptor,
21
+ OperationOptions,
22
+ OperationRequest,
23
+ OperationResponse,
24
+ execute_pipeline,
25
+ retry,
26
+ )
27
+
28
+ if TYPE_CHECKING:
29
+ import capo_codecatalyst.types.get_user_details_request
30
+ import capo_codecatalyst.types.get_user_details_response
31
+ import capo_codecatalyst.types.verify_session_response
32
+
33
+
34
+ class CodeCatalystClientConfig(TypedDict, total=False, closed=True):
35
+ operation_interceptors: Iterable[Interceptor[Any, Any]]
36
+ retry_max_attempts: int | None
37
+ use_fips: bool | None
38
+ region: str | None
39
+ endpoint: str | None
40
+ bearer_provider: BearerTokenProvider | None
41
+
42
+
43
+ class CodeCatalystClient:
44
+ """A client for the ``CodeCatalyst`` service.
45
+
46
+ Args:
47
+ http_handler: HTTP handler for sending requests. If not provided, creates a default handler.
48
+ operation_interceptors: Interceptors that wrap every operation call. If not provided, defaults to an empty list.
49
+ retry_max_attempts: Maximum number of times to retry a failed operation. Defaults to 3.
50
+ use_fips: The value of the ``AWS::UseFIPS`` endpoint parameter.
51
+ region: The value of the ``AWS::Region`` endpoint parameter.
52
+ endpoint: The value of the ``SDK::Endpoint`` endpoint parameter.
53
+ bearer: Bearer token for authentication.
54
+ bearer_provider: Provider that resolves bearer tokens. Takes precedence over ``bearer``.
55
+ """
56
+
57
+ def __init__(
58
+ self,
59
+ http_handler: BaseHandler | None = None,
60
+ operation_interceptors: Iterable[Interceptor[Any, Any]] | None = None,
61
+ retry_max_attempts: int | None = None,
62
+ use_fips: bool | None = None,
63
+ region: str | None = None,
64
+ endpoint: str | None = None,
65
+ bearer: str | None = None,
66
+ bearer_provider: BearerTokenProvider | None = None,
67
+ ):
68
+ self._client = Client(http_handler).wrap_with_middleware(
69
+ lambda next: AuthMiddleware(next)
70
+ )
71
+ if bearer is not None and bearer_provider is not None:
72
+ warnings.warn(
73
+ "Both bearer and bearer_provider given; provider takes precedence"
74
+ )
75
+ if bearer_provider is None and bearer is not None:
76
+ bearer_provider = StaticBearerTokenProvider(bearer)
77
+ self._config = CodeCatalystClientConfig(
78
+ {
79
+ "operation_interceptors": operation_interceptors or [],
80
+ "retry_max_attempts": retry_max_attempts,
81
+ "use_fips": use_fips,
82
+ "region": region,
83
+ "endpoint": endpoint,
84
+ "bearer_provider": bearer_provider,
85
+ }
86
+ )
87
+
88
+ # resources
89
+ self.access_token = AccessToken(self)
90
+ self.space = Space(self)
91
+
92
+ def operation_options(
93
+ self, config_overrides: Optional[CodeCatalystClientConfig] = None
94
+ ) -> tuple[Iterable[Interceptor[Any, Any]], OperationOptions]:
95
+ overrides: CodeCatalystClientConfig = config_overrides or {}
96
+ interceptors_: list[Interceptor[Any, Any]] = [
97
+ *overrides.get(
98
+ "operation_interceptors", self._config.get("operation_interceptors", [])
99
+ ),
100
+ aws_config(),
101
+ retry(),
102
+ ]
103
+ options_: OperationOptions = OperationOptions(
104
+ client=self._client,
105
+ retry_max_attempts=overrides.get(
106
+ "retry_max_attempts", self._config.get("retry_max_attempts")
107
+ ),
108
+ use_fips=overrides.get("use_fips", self._config.get("use_fips")),
109
+ region=overrides.get("region", self._config.get("region")),
110
+ endpoint=overrides.get("endpoint", self._config.get("endpoint")),
111
+ bearer_provider=overrides.get(
112
+ "bearer_provider", self._config.get("bearer_provider")
113
+ ),
114
+ )
115
+ return interceptors_, options_
116
+
117
+ def get_user_details(
118
+ self,
119
+ *,
120
+ config_overrides: Optional[CodeCatalystClientConfig] = None,
121
+ id: Optional[str] = None,
122
+ user_name: Optional[str] = None,
123
+ ) -> "capo_codecatalyst.types.get_user_details_response.GetUserDetailsResponse":
124
+ """<p>Returns information about a user. </p>
125
+
126
+ Args:
127
+ id: <p>The system-generated unique ID of the user. </p>
128
+ user_name: <p>The name of the user as displayed in Amazon CodeCatalyst.</p>
129
+
130
+ Raises:
131
+ 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>
132
+ 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>
133
+ 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>
134
+ 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>
135
+ capo_codecatalyst.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
136
+ 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>
137
+ capo_codecatalyst.errors.UnknownServiceError: The service returned an error code this client does not model.
138
+ """
139
+
140
+ def _handler(
141
+ req: "OperationRequest[capo_codecatalyst.types.get_user_details_request.GetUserDetailsRequest]",
142
+ ) -> OperationResponse[
143
+ "capo_codecatalyst.types.get_user_details_response.GetUserDetailsResponse"
144
+ ]:
145
+ import capo_codecatalyst._operations.code_catalyst.get_user_details
146
+
147
+ output, http_response = (
148
+ capo_codecatalyst._operations.code_catalyst.get_user_details.get_user_details(
149
+ req.options, req.input
150
+ )
151
+ )
152
+ return OperationResponse(output=output, response=http_response)
153
+
154
+ interceptors_, options_ = self.operation_options(config_overrides)
155
+ input_: capo_codecatalyst.types.get_user_details_request.GetUserDetailsRequest = {}
156
+ if id is not None:
157
+ input_["id"] = id
158
+ if user_name is not None:
159
+ input_["user_name"] = user_name
160
+
161
+ response = execute_pipeline(
162
+ OperationRequest(input=input_, options=options_),
163
+ handler=_handler,
164
+ interceptors=list(interceptors_),
165
+ )
166
+ response.response.close()
167
+ return response.output
168
+
169
+ def verify_session(
170
+ self, *, config_overrides: Optional[CodeCatalystClientConfig] = None
171
+ ) -> "capo_codecatalyst.types.verify_session_response.VerifySessionResponse":
172
+ """<p>Verifies whether the calling user has a valid Amazon CodeCatalyst login and session. If successful, this returns the ID of the user in Amazon CodeCatalyst.</p>
173
+
174
+ Raises:
175
+ 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>
176
+ 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>
177
+ 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>
178
+ 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>
179
+ capo_codecatalyst.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
180
+ 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>
181
+ capo_codecatalyst.errors.UnknownServiceError: The service returned an error code this client does not model.
182
+ """
183
+
184
+ def _handler(
185
+ req: "OperationRequest[None]",
186
+ ) -> OperationResponse[
187
+ "capo_codecatalyst.types.verify_session_response.VerifySessionResponse"
188
+ ]:
189
+ import capo_codecatalyst._operations.code_catalyst.verify_session
190
+
191
+ output, http_response = (
192
+ capo_codecatalyst._operations.code_catalyst.verify_session.verify_session(
193
+ req.options
194
+ )
195
+ )
196
+ return OperationResponse(output=output, response=http_response)
197
+
198
+ interceptors_, options_ = self.operation_options(config_overrides)
199
+
200
+ response = execute_pipeline(
201
+ OperationRequest(input=None, options=options_),
202
+ handler=_handler,
203
+ interceptors=list(interceptors_),
204
+ )
205
+ response.response.close()
206
+ return response.output
207
+
208
+ def __enter__(self) -> Self:
209
+ return self
210
+
211
+ def __exit__(self, exc_type: Any, exc: Any, tb: Any):
212
+ self._client.close()
@@ -0,0 +1,33 @@
1
+ from __future__ import annotations
2
+
3
+ from ._base import (
4
+ CodeCatalystError as CodeCatalystError,
5
+ )
6
+ from ._base import (
7
+ DeserializationError as DeserializationError,
8
+ )
9
+ from ._base import (
10
+ SerializationError as SerializationError,
11
+ )
12
+ from ._base import (
13
+ ServiceError as ServiceError,
14
+ )
15
+ from ._base import (
16
+ UnknownServiceError as UnknownServiceError,
17
+ )
18
+ from ._base import (
19
+ WaiterFailedError as WaiterFailedError,
20
+ )
21
+ from ._base import (
22
+ WaiterTimeoutError as WaiterTimeoutError,
23
+ )
24
+ from .access_denied_exception import AccessDeniedException as AccessDeniedException
25
+ from .conflict_exception import ConflictException as ConflictException
26
+ from .resource_not_found_exception import (
27
+ ResourceNotFoundException as ResourceNotFoundException,
28
+ )
29
+ from .service_quota_exceeded_exception import (
30
+ ServiceQuotaExceededException as ServiceQuotaExceededException,
31
+ )
32
+ from .throttling_exception import ThrottlingException as ThrottlingException
33
+ from .validation_exception import ValidationException as ValidationException
@@ -0,0 +1,94 @@
1
+ from typing import Literal
2
+
3
+
4
+ class CodeCatalystError(Exception):
5
+ """Base class for all CodeCatalyst service errors."""
6
+
7
+
8
+ class ServiceError(CodeCatalystError):
9
+ """Base class for all modeled service errors.
10
+
11
+ Args:
12
+ fault: ``"client"`` or ``"server"``.
13
+ is_throttling_error: Whether this error is a throttling error.
14
+ is_retryable: Whether this error is retryable.
15
+ code: The wire error code, or ``None``.
16
+ message: The error message, or ``None``.
17
+ """
18
+
19
+ code: str | None = None
20
+
21
+ def __init__(
22
+ self,
23
+ fault: Literal["client", "server"],
24
+ *,
25
+ is_throttling_error: bool,
26
+ is_retryable: bool,
27
+ code: str | None = None,
28
+ message: str | None = None,
29
+ ) -> None:
30
+ super().__init__(f"{code or '<no code>'}: {message or '<no message>'}")
31
+ self.fault = fault
32
+ self.is_throttling_error = is_throttling_error
33
+ self.is_retryable = is_retryable
34
+ self.code = code
35
+ self.message = message
36
+
37
+
38
+ class SerializationError(CodeCatalystError):
39
+ """Raised when a value cannot be serialized."""
40
+
41
+
42
+ class DeserializationError(CodeCatalystError):
43
+ """Raised when a value cannot be deserialized or a required member is missing."""
44
+
45
+
46
+ class UnknownServiceError(ServiceError):
47
+ """Raised when the server returns an error code the client does not model.
48
+
49
+ Args:
50
+ code: ``<Code>`` text from the response body, or ``None`` if absent.
51
+ message: ``<Message>`` text from the response body, or ``None``.
52
+ response: The original HTTP response object, for arbitrary inspection.
53
+ """
54
+
55
+ def __init__(
56
+ self, *, code: str | None, message: str | None, response: object
57
+ ) -> None:
58
+ _status = getattr(response, "status", 500)
59
+ _fault: Literal["client", "server"] = "client" if _status < 500 else "server"
60
+ _throttling = _status == 429
61
+ _retryable = _throttling or _status >= 500
62
+ super().__init__(
63
+ _fault,
64
+ is_throttling_error=_throttling,
65
+ is_retryable=_retryable,
66
+ code=code,
67
+ message=message,
68
+ )
69
+ self.response = response
70
+
71
+
72
+ class WaiterFailedError(CodeCatalystError):
73
+ """Raised when a waiter hits an acceptor with ``state="failure"``.
74
+
75
+ Args:
76
+ waiter_name: snake_case waiter name (e.g. ``bucket_exists``).
77
+ reason: Short description of which acceptor fired.
78
+ """
79
+
80
+ def __init__(self, waiter_name: str, reason: str) -> None:
81
+ super().__init__(f"waiter {waiter_name} failed: {reason}")
82
+ self.waiter_name = waiter_name
83
+ self.reason = reason
84
+
85
+
86
+ class WaiterTimeoutError(CodeCatalystError):
87
+ """Raised when a waiter exhausts ``max_wait_time`` without a terminal acceptor."""
88
+
89
+ def __init__(self, waiter_name: str, max_wait_time: float) -> None:
90
+ super().__init__(
91
+ f"waiter {waiter_name} timed out after {max_wait_time} seconds"
92
+ )
93
+ self.waiter_name = waiter_name
94
+ self.max_wait_time = max_wait_time
@@ -0,0 +1,47 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codecatalyst#AccessDeniedException``."""
2
+
3
+ from typing_extensions import TypedDict
4
+
5
+ from capo_codecatalyst.errors import DeserializationError, ServiceError
6
+
7
+
8
+ class AccessDeniedException_(TypedDict, closed=True):
9
+ message: "str"
10
+
11
+
12
+ # --- restJson1 ser/de ---
13
+ def serialize_json(value: AccessDeniedException_) -> dict:
14
+ out: dict = {}
15
+ out["message"] = value["message"]
16
+ return out
17
+
18
+
19
+ def deserialize_json(data: dict) -> AccessDeniedException_:
20
+ out: AccessDeniedException_ = {} # type: ignore[typeddict-item]
21
+ if data.get("message") is not None:
22
+ out["message"] = data["message"]
23
+ else:
24
+ raise DeserializationError("AccessDeniedException_.message required")
25
+ return out
26
+
27
+
28
+ class AccessDeniedException(ServiceError):
29
+ """Modeled error for Smithy shape ``com.amazonaws.codecatalyst#AccessDeniedException``."""
30
+
31
+ code: str | None = "AccessDeniedException"
32
+
33
+ def __init__(self, data: AccessDeniedException_, message: str | None = None):
34
+ super().__init__(
35
+ "client",
36
+ is_throttling_error=False,
37
+ is_retryable=False,
38
+ code="AccessDeniedException",
39
+ message=message,
40
+ )
41
+ self.data = data
42
+
43
+ @classmethod
44
+ def from_json(
45
+ cls, data: dict, message: str | None = None
46
+ ) -> "AccessDeniedException":
47
+ return cls(deserialize_json(data), message)
@@ -0,0 +1,45 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codecatalyst#ConflictException``."""
2
+
3
+ from typing_extensions import TypedDict
4
+
5
+ from capo_codecatalyst.errors import DeserializationError, ServiceError
6
+
7
+
8
+ class ConflictException_(TypedDict, closed=True):
9
+ message: "str"
10
+
11
+
12
+ # --- restJson1 ser/de ---
13
+ def serialize_json(value: ConflictException_) -> dict:
14
+ out: dict = {}
15
+ out["message"] = value["message"]
16
+ return out
17
+
18
+
19
+ def deserialize_json(data: dict) -> ConflictException_:
20
+ out: ConflictException_ = {} # type: ignore[typeddict-item]
21
+ if data.get("message") is not None:
22
+ out["message"] = data["message"]
23
+ else:
24
+ raise DeserializationError("ConflictException_.message required")
25
+ return out
26
+
27
+
28
+ class ConflictException(ServiceError):
29
+ """Modeled error for Smithy shape ``com.amazonaws.codecatalyst#ConflictException``."""
30
+
31
+ code: str | None = "ConflictException"
32
+
33
+ def __init__(self, data: ConflictException_, message: str | None = None):
34
+ super().__init__(
35
+ "client",
36
+ is_throttling_error=False,
37
+ is_retryable=False,
38
+ code="ConflictException",
39
+ message=message,
40
+ )
41
+ self.data = data
42
+
43
+ @classmethod
44
+ def from_json(cls, data: dict, message: str | None = None) -> "ConflictException":
45
+ return cls(deserialize_json(data), message)
@@ -0,0 +1,47 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codecatalyst#ResourceNotFoundException``."""
2
+
3
+ from typing_extensions import TypedDict
4
+
5
+ from capo_codecatalyst.errors import DeserializationError, ServiceError
6
+
7
+
8
+ class ResourceNotFoundException_(TypedDict, closed=True):
9
+ message: "str"
10
+
11
+
12
+ # --- restJson1 ser/de ---
13
+ def serialize_json(value: ResourceNotFoundException_) -> dict:
14
+ out: dict = {}
15
+ out["message"] = value["message"]
16
+ return out
17
+
18
+
19
+ def deserialize_json(data: dict) -> ResourceNotFoundException_:
20
+ out: ResourceNotFoundException_ = {} # type: ignore[typeddict-item]
21
+ if data.get("message") is not None:
22
+ out["message"] = data["message"]
23
+ else:
24
+ raise DeserializationError("ResourceNotFoundException_.message required")
25
+ return out
26
+
27
+
28
+ class ResourceNotFoundException(ServiceError):
29
+ """Modeled error for Smithy shape ``com.amazonaws.codecatalyst#ResourceNotFoundException``."""
30
+
31
+ code: str | None = "ResourceNotFoundException"
32
+
33
+ def __init__(self, data: ResourceNotFoundException_, message: str | None = None):
34
+ super().__init__(
35
+ "client",
36
+ is_throttling_error=False,
37
+ is_retryable=False,
38
+ code="ResourceNotFoundException",
39
+ message=message,
40
+ )
41
+ self.data = data
42
+
43
+ @classmethod
44
+ def from_json(
45
+ cls, data: dict, message: str | None = None
46
+ ) -> "ResourceNotFoundException":
47
+ return cls(deserialize_json(data), message)
@@ -0,0 +1,49 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codecatalyst#ServiceQuotaExceededException``."""
2
+
3
+ from typing_extensions import TypedDict
4
+
5
+ from capo_codecatalyst.errors import DeserializationError, ServiceError
6
+
7
+
8
+ class ServiceQuotaExceededException_(TypedDict, closed=True):
9
+ message: "str"
10
+
11
+
12
+ # --- restJson1 ser/de ---
13
+ def serialize_json(value: ServiceQuotaExceededException_) -> dict:
14
+ out: dict = {}
15
+ out["message"] = value["message"]
16
+ return out
17
+
18
+
19
+ def deserialize_json(data: dict) -> ServiceQuotaExceededException_:
20
+ out: ServiceQuotaExceededException_ = {} # type: ignore[typeddict-item]
21
+ if data.get("message") is not None:
22
+ out["message"] = data["message"]
23
+ else:
24
+ raise DeserializationError("ServiceQuotaExceededException_.message required")
25
+ return out
26
+
27
+
28
+ class ServiceQuotaExceededException(ServiceError):
29
+ """Modeled error for Smithy shape ``com.amazonaws.codecatalyst#ServiceQuotaExceededException``."""
30
+
31
+ code: str | None = "ServiceQuotaExceededException"
32
+
33
+ def __init__(
34
+ self, data: ServiceQuotaExceededException_, message: str | None = None
35
+ ):
36
+ super().__init__(
37
+ "client",
38
+ is_throttling_error=False,
39
+ is_retryable=False,
40
+ code="ServiceQuotaExceededException",
41
+ message=message,
42
+ )
43
+ self.data = data
44
+
45
+ @classmethod
46
+ def from_json(
47
+ cls, data: dict, message: str | None = None
48
+ ) -> "ServiceQuotaExceededException":
49
+ return cls(deserialize_json(data), message)
@@ -0,0 +1,45 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codecatalyst#ThrottlingException``."""
2
+
3
+ from typing_extensions import TypedDict
4
+
5
+ from capo_codecatalyst.errors import DeserializationError, ServiceError
6
+
7
+
8
+ class ThrottlingException_(TypedDict, closed=True):
9
+ message: "str"
10
+
11
+
12
+ # --- restJson1 ser/de ---
13
+ def serialize_json(value: ThrottlingException_) -> dict:
14
+ out: dict = {}
15
+ out["message"] = value["message"]
16
+ return out
17
+
18
+
19
+ def deserialize_json(data: dict) -> ThrottlingException_:
20
+ out: ThrottlingException_ = {} # type: ignore[typeddict-item]
21
+ if data.get("message") is not None:
22
+ out["message"] = data["message"]
23
+ else:
24
+ raise DeserializationError("ThrottlingException_.message required")
25
+ return out
26
+
27
+
28
+ class ThrottlingException(ServiceError):
29
+ """Modeled error for Smithy shape ``com.amazonaws.codecatalyst#ThrottlingException``."""
30
+
31
+ code: str | None = "ThrottlingException"
32
+
33
+ def __init__(self, data: ThrottlingException_, message: str | None = None):
34
+ super().__init__(
35
+ "client",
36
+ is_throttling_error=False,
37
+ is_retryable=True,
38
+ code="ThrottlingException",
39
+ message=message,
40
+ )
41
+ self.data = data
42
+
43
+ @classmethod
44
+ def from_json(cls, data: dict, message: str | None = None) -> "ThrottlingException":
45
+ return cls(deserialize_json(data), message)
@@ -0,0 +1,45 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codecatalyst#ValidationException``."""
2
+
3
+ from typing_extensions import TypedDict
4
+
5
+ from capo_codecatalyst.errors import DeserializationError, ServiceError
6
+
7
+
8
+ class ValidationException_(TypedDict, closed=True):
9
+ message: "str"
10
+
11
+
12
+ # --- restJson1 ser/de ---
13
+ def serialize_json(value: ValidationException_) -> dict:
14
+ out: dict = {}
15
+ out["message"] = value["message"]
16
+ return out
17
+
18
+
19
+ def deserialize_json(data: dict) -> ValidationException_:
20
+ out: ValidationException_ = {} # type: ignore[typeddict-item]
21
+ if data.get("message") is not None:
22
+ out["message"] = data["message"]
23
+ else:
24
+ raise DeserializationError("ValidationException_.message required")
25
+ return out
26
+
27
+
28
+ class ValidationException(ServiceError):
29
+ """Modeled error for Smithy shape ``com.amazonaws.codecatalyst#ValidationException``."""
30
+
31
+ code: str | None = "ValidationException"
32
+
33
+ def __init__(self, data: ValidationException_, message: str | None = None):
34
+ super().__init__(
35
+ "client",
36
+ is_throttling_error=False,
37
+ is_retryable=False,
38
+ code="ValidationException",
39
+ message=message,
40
+ )
41
+ self.data = data
42
+
43
+ @classmethod
44
+ def from_json(cls, data: dict, message: str | None = None) -> "ValidationException":
45
+ return cls(deserialize_json(data), message)
File without changes
@@ -0,0 +1,12 @@
1
+ """Generated from Smithy prelude shape ``smithy.api#Blob``."""
2
+
3
+ import base64
4
+
5
+
6
+ # --- restJson1 ser/de ---
7
+ def serialize_json(value: bytes) -> str:
8
+ return base64.b64encode(value).decode("ascii")
9
+
10
+
11
+ def deserialize_json(data: str) -> bytes:
12
+ return base64.b64decode(data)
@@ -0,0 +1,17 @@
1
+ """Generated from Smithy prelude shape ``smithy.api#Timestamp``."""
2
+
3
+ import datetime
4
+
5
+
6
+ # --- restJson1 ser/de ---
7
+ def serialize_json(value: datetime.datetime) -> float:
8
+ value = (
9
+ value.astimezone(datetime.timezone.utc)
10
+ if value.tzinfo
11
+ else value.replace(tzinfo=datetime.timezone.utc)
12
+ )
13
+ return value.timestamp()
14
+
15
+
16
+ def deserialize_json(data: float) -> datetime.datetime:
17
+ return datetime.datetime.fromtimestamp(float(data), tz=datetime.timezone.utc)
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codecatalyst#AccessTokenId``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ AccessTokenId: TypeAlias = str
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codecatalyst#AccessTokenName``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ AccessTokenName: TypeAlias = str
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codecatalyst#AccessTokenSecret``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ AccessTokenSecret: TypeAlias = str