capo-codebuild 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 (419) hide show
  1. capo_codebuild/__init__.py +70 -0
  2. capo_codebuild/_async.py +25 -0
  3. capo_codebuild/_auth/_identity.py +16 -0
  4. capo_codebuild/_auth/_providers.py +886 -0
  5. capo_codebuild/_auth/_signers.py +88 -0
  6. capo_codebuild/_auth/_sigv4.py +434 -0
  7. capo_codebuild/_auth/_zapros_handler.py +80 -0
  8. capo_codebuild/_iter.py +113 -0
  9. capo_codebuild/_operations/code_build_20161006/batch_delete_builds.py +150 -0
  10. capo_codebuild/_operations/code_build_20161006/batch_get_build_batches.py +148 -0
  11. capo_codebuild/_operations/code_build_20161006/batch_get_builds.py +148 -0
  12. capo_codebuild/_operations/code_build_20161006/batch_get_command_executions.py +148 -0
  13. capo_codebuild/_operations/code_build_20161006/batch_get_fleets.py +148 -0
  14. capo_codebuild/_operations/code_build_20161006/batch_get_projects.py +150 -0
  15. capo_codebuild/_operations/code_build_20161006/batch_get_report_groups.py +148 -0
  16. capo_codebuild/_operations/code_build_20161006/batch_get_reports.py +148 -0
  17. capo_codebuild/_operations/code_build_20161006/batch_get_sandboxes.py +150 -0
  18. capo_codebuild/_operations/code_build_20161006/create_fleet.py +161 -0
  19. capo_codebuild/_operations/code_build_20161006/create_project.py +169 -0
  20. capo_codebuild/_operations/code_build_20161006/create_report_group.py +162 -0
  21. capo_codebuild/_operations/code_build_20161006/create_webhook.py +166 -0
  22. capo_codebuild/_operations/code_build_20161006/delete_build_batch.py +150 -0
  23. capo_codebuild/_operations/code_build_20161006/delete_fleet.py +134 -0
  24. capo_codebuild/_operations/code_build_20161006/delete_project.py +138 -0
  25. capo_codebuild/_operations/code_build_20161006/delete_report.py +138 -0
  26. capo_codebuild/_operations/code_build_20161006/delete_report_group.py +140 -0
  27. capo_codebuild/_operations/code_build_20161006/delete_resource_policy.py +142 -0
  28. capo_codebuild/_operations/code_build_20161006/delete_source_credentials.py +155 -0
  29. capo_codebuild/_operations/code_build_20161006/delete_webhook.py +148 -0
  30. capo_codebuild/_operations/code_build_20161006/describe_code_coverages.py +149 -0
  31. capo_codebuild/_operations/code_build_20161006/describe_test_cases.py +155 -0
  32. capo_codebuild/_operations/code_build_20161006/get_report_group_trend.py +154 -0
  33. capo_codebuild/_operations/code_build_20161006/get_resource_policy.py +153 -0
  34. capo_codebuild/_operations/code_build_20161006/import_source_credentials.py +162 -0
  35. capo_codebuild/_operations/code_build_20161006/invalidate_project_cache.py +147 -0
  36. capo_codebuild/_operations/code_build_20161006/list_build_batches.py +151 -0
  37. capo_codebuild/_operations/code_build_20161006/list_build_batches_for_project.py +154 -0
  38. capo_codebuild/_operations/code_build_20161006/list_builds.py +144 -0
  39. capo_codebuild/_operations/code_build_20161006/list_builds_for_project.py +153 -0
  40. capo_codebuild/_operations/code_build_20161006/list_command_executions_for_sandbox.py +153 -0
  41. capo_codebuild/_operations/code_build_20161006/list_curated_environment_images.py +142 -0
  42. capo_codebuild/_operations/code_build_20161006/list_fleets.py +145 -0
  43. capo_codebuild/_operations/code_build_20161006/list_projects.py +149 -0
  44. capo_codebuild/_operations/code_build_20161006/list_report_groups.py +151 -0
  45. capo_codebuild/_operations/code_build_20161006/list_reports.py +145 -0
  46. capo_codebuild/_operations/code_build_20161006/list_reports_for_report_group.py +154 -0
  47. capo_codebuild/_operations/code_build_20161006/list_sandboxes.py +148 -0
  48. capo_codebuild/_operations/code_build_20161006/list_sandboxes_for_project.py +157 -0
  49. capo_codebuild/_operations/code_build_20161006/list_shared_projects.py +151 -0
  50. capo_codebuild/_operations/code_build_20161006/list_shared_report_groups.py +149 -0
  51. capo_codebuild/_operations/code_build_20161006/list_source_credentials.py +147 -0
  52. capo_codebuild/_operations/code_build_20161006/put_resource_policy.py +153 -0
  53. capo_codebuild/_operations/code_build_20161006/retry_build.py +153 -0
  54. capo_codebuild/_operations/code_build_20161006/retry_build_batch.py +153 -0
  55. capo_codebuild/_operations/code_build_20161006/start_build.py +169 -0
  56. capo_codebuild/_operations/code_build_20161006/start_build_batch.py +167 -0
  57. capo_codebuild/_operations/code_build_20161006/start_command_execution.py +153 -0
  58. capo_codebuild/_operations/code_build_20161006/start_sandbox.py +157 -0
  59. capo_codebuild/_operations/code_build_20161006/start_sandbox_connection.py +152 -0
  60. capo_codebuild/_operations/code_build_20161006/stop_build.py +148 -0
  61. capo_codebuild/_operations/code_build_20161006/stop_build_batch.py +152 -0
  62. capo_codebuild/_operations/code_build_20161006/stop_sandbox.py +148 -0
  63. capo_codebuild/_operations/code_build_20161006/update_fleet.py +161 -0
  64. capo_codebuild/_operations/code_build_20161006/update_project.py +164 -0
  65. capo_codebuild/_operations/code_build_20161006/update_project_visibility.py +156 -0
  66. capo_codebuild/_operations/code_build_20161006/update_report_group.py +156 -0
  67. capo_codebuild/_operations/code_build_20161006/update_webhook.py +160 -0
  68. capo_codebuild/_pagination.py +21 -0
  69. capo_codebuild/_protocol/__init__.py +1 -0
  70. capo_codebuild/_protocol/errors.py +93 -0
  71. capo_codebuild/_protocol/eventstream.py +238 -0
  72. capo_codebuild/_protocol/serialize.py +47 -0
  73. capo_codebuild/_protocol/xml.py +33 -0
  74. capo_codebuild/_rule_engine/__init__.py +0 -0
  75. capo_codebuild/_rule_engine/_aws_partition.py +160 -0
  76. capo_codebuild/_rule_engine/_endpoint_rule_set.py +136 -0
  77. capo_codebuild/_rule_engine/_endpoint_runtime.py +389 -0
  78. capo_codebuild/_services/_aws_config.py +160 -0
  79. capo_codebuild/_services/_pipeline.py +198 -0
  80. capo_codebuild/_services/async_code_build.py +4509 -0
  81. capo_codebuild/_services/code_build.py +4450 -0
  82. capo_codebuild/errors/__init__.py +37 -0
  83. capo_codebuild/errors/_base.py +94 -0
  84. capo_codebuild/errors/account_limit_exceeded_exception.py +53 -0
  85. capo_codebuild/errors/account_suspended_exception.py +51 -0
  86. capo_codebuild/errors/invalid_input_exception.py +51 -0
  87. capo_codebuild/errors/o_auth_provider_exception.py +51 -0
  88. capo_codebuild/errors/resource_already_exists_exception.py +53 -0
  89. capo_codebuild/errors/resource_not_found_exception.py +51 -0
  90. capo_codebuild/py.typed +0 -0
  91. capo_codebuild/types/_prelude/blob.py +12 -0
  92. capo_codebuild/types/_prelude/timestamp.py +17 -0
  93. capo_codebuild/types/artifact_namespace.py +17 -0
  94. capo_codebuild/types/artifact_packaging.py +17 -0
  95. capo_codebuild/types/artifacts_type.py +18 -0
  96. capo_codebuild/types/auth_type.py +20 -0
  97. capo_codebuild/types/auto_retry_config.py +47 -0
  98. capo_codebuild/types/batch_delete_builds_input.py +37 -0
  99. capo_codebuild/types/batch_delete_builds_output.py +57 -0
  100. capo_codebuild/types/batch_get_build_batches_input.py +39 -0
  101. capo_codebuild/types/batch_get_build_batches_output.py +59 -0
  102. capo_codebuild/types/batch_get_builds_input.py +37 -0
  103. capo_codebuild/types/batch_get_builds_output.py +53 -0
  104. capo_codebuild/types/batch_get_command_executions_input.py +55 -0
  105. capo_codebuild/types/batch_get_command_executions_output.py +63 -0
  106. capo_codebuild/types/batch_get_fleets_input.py +39 -0
  107. capo_codebuild/types/batch_get_fleets_output.py +53 -0
  108. capo_codebuild/types/batch_get_projects_input.py +39 -0
  109. capo_codebuild/types/batch_get_projects_output.py +55 -0
  110. capo_codebuild/types/batch_get_report_groups_input.py +45 -0
  111. capo_codebuild/types/batch_get_report_groups_output.py +59 -0
  112. capo_codebuild/types/batch_get_reports_input.py +39 -0
  113. capo_codebuild/types/batch_get_reports_output.py +55 -0
  114. capo_codebuild/types/batch_get_sandboxes_input.py +37 -0
  115. capo_codebuild/types/batch_get_sandboxes_output.py +55 -0
  116. capo_codebuild/types/batch_report_mode_type.py +17 -0
  117. capo_codebuild/types/batch_restrictions.py +68 -0
  118. capo_codebuild/types/boolean.py +5 -0
  119. capo_codebuild/types/bucket_owner_access.py +19 -0
  120. capo_codebuild/types/build.py +455 -0
  121. capo_codebuild/types/build_artifacts.py +83 -0
  122. capo_codebuild/types/build_artifacts_list.py +31 -0
  123. capo_codebuild/types/build_batch.py +416 -0
  124. capo_codebuild/types/build_batch_filter.py +36 -0
  125. capo_codebuild/types/build_batch_ids.py +17 -0
  126. capo_codebuild/types/build_batch_phase.py +108 -0
  127. capo_codebuild/types/build_batch_phase_type.py +22 -0
  128. capo_codebuild/types/build_batch_phases.py +33 -0
  129. capo_codebuild/types/build_batches.py +29 -0
  130. capo_codebuild/types/build_group.py +93 -0
  131. capo_codebuild/types/build_groups.py +29 -0
  132. capo_codebuild/types/build_ids.py +17 -0
  133. capo_codebuild/types/build_not_deleted.py +35 -0
  134. capo_codebuild/types/build_phase.py +104 -0
  135. capo_codebuild/types/build_phase_type.py +26 -0
  136. capo_codebuild/types/build_phases.py +29 -0
  137. capo_codebuild/types/build_report_arns.py +17 -0
  138. capo_codebuild/types/build_status_config.py +34 -0
  139. capo_codebuild/types/build_summaries.py +29 -0
  140. capo_codebuild/types/build_summary.py +100 -0
  141. capo_codebuild/types/build_time_out.py +5 -0
  142. capo_codebuild/types/builds.py +29 -0
  143. capo_codebuild/types/builds_not_deleted.py +33 -0
  144. capo_codebuild/types/cache_mode.py +18 -0
  145. capo_codebuild/types/cache_type.py +18 -0
  146. capo_codebuild/types/cloud_watch_logs_config.py +54 -0
  147. capo_codebuild/types/code_coverage.py +114 -0
  148. capo_codebuild/types/code_coverage_report_summary.py +80 -0
  149. capo_codebuild/types/code_coverages.py +29 -0
  150. capo_codebuild/types/command_execution.py +149 -0
  151. capo_codebuild/types/command_execution_ids.py +19 -0
  152. capo_codebuild/types/command_executions.py +33 -0
  153. capo_codebuild/types/command_type.py +14 -0
  154. capo_codebuild/types/compute_configuration.py +64 -0
  155. capo_codebuild/types/compute_type.py +27 -0
  156. capo_codebuild/types/compute_types_allowed.py +19 -0
  157. capo_codebuild/types/create_fleet_input.py +205 -0
  158. capo_codebuild/types/create_fleet_output.py +34 -0
  159. capo_codebuild/types/create_project_input.py +314 -0
  160. capo_codebuild/types/create_project_output.py +36 -0
  161. capo_codebuild/types/create_report_group_input.py +80 -0
  162. capo_codebuild/types/create_report_group_output.py +38 -0
  163. capo_codebuild/types/create_webhook_input.py +123 -0
  164. capo_codebuild/types/create_webhook_output.py +36 -0
  165. capo_codebuild/types/credential_provider_type.py +14 -0
  166. capo_codebuild/types/debug_session.py +35 -0
  167. capo_codebuild/types/delete_build_batch_input.py +31 -0
  168. capo_codebuild/types/delete_build_batch_output.py +64 -0
  169. capo_codebuild/types/delete_fleet_input.py +31 -0
  170. capo_codebuild/types/delete_fleet_output.py +18 -0
  171. capo_codebuild/types/delete_project_input.py +31 -0
  172. capo_codebuild/types/delete_project_output.py +18 -0
  173. capo_codebuild/types/delete_report_group_input.py +39 -0
  174. capo_codebuild/types/delete_report_group_output.py +18 -0
  175. capo_codebuild/types/delete_report_input.py +31 -0
  176. capo_codebuild/types/delete_report_output.py +18 -0
  177. capo_codebuild/types/delete_resource_policy_input.py +31 -0
  178. capo_codebuild/types/delete_resource_policy_output.py +18 -0
  179. capo_codebuild/types/delete_source_credentials_input.py +31 -0
  180. capo_codebuild/types/delete_source_credentials_output.py +28 -0
  181. capo_codebuild/types/delete_webhook_input.py +31 -0
  182. capo_codebuild/types/delete_webhook_output.py +18 -0
  183. capo_codebuild/types/describe_code_coverages_input.py +118 -0
  184. capo_codebuild/types/describe_code_coverages_output.py +47 -0
  185. capo_codebuild/types/describe_test_cases_input.py +59 -0
  186. capo_codebuild/types/describe_test_cases_output.py +43 -0
  187. capo_codebuild/types/docker_server.py +81 -0
  188. capo_codebuild/types/docker_server_status.py +34 -0
  189. capo_codebuild/types/environment_image.py +49 -0
  190. capo_codebuild/types/environment_images.py +33 -0
  191. capo_codebuild/types/environment_language.py +53 -0
  192. capo_codebuild/types/environment_languages.py +35 -0
  193. capo_codebuild/types/environment_platform.py +57 -0
  194. capo_codebuild/types/environment_platforms.py +35 -0
  195. capo_codebuild/types/environment_type.py +27 -0
  196. capo_codebuild/types/environment_variable.py +60 -0
  197. capo_codebuild/types/environment_variable_type.py +18 -0
  198. capo_codebuild/types/environment_variables.py +35 -0
  199. capo_codebuild/types/exported_environment_variable.py +35 -0
  200. capo_codebuild/types/exported_environment_variables.py +39 -0
  201. capo_codebuild/types/file_system_type.py +14 -0
  202. capo_codebuild/types/filter_group.py +29 -0
  203. capo_codebuild/types/filter_groups.py +29 -0
  204. capo_codebuild/types/fleet.py +257 -0
  205. capo_codebuild/types/fleet_arns.py +17 -0
  206. capo_codebuild/types/fleet_capacity.py +5 -0
  207. capo_codebuild/types/fleet_context_code.py +20 -0
  208. capo_codebuild/types/fleet_name.py +5 -0
  209. capo_codebuild/types/fleet_names.py +17 -0
  210. capo_codebuild/types/fleet_overflow_behavior.py +17 -0
  211. capo_codebuild/types/fleet_proxy_rule.py +81 -0
  212. capo_codebuild/types/fleet_proxy_rule_behavior.py +17 -0
  213. capo_codebuild/types/fleet_proxy_rule_effect_type.py +17 -0
  214. capo_codebuild/types/fleet_proxy_rule_entities.py +17 -0
  215. capo_codebuild/types/fleet_proxy_rule_type.py +17 -0
  216. capo_codebuild/types/fleet_proxy_rules.py +31 -0
  217. capo_codebuild/types/fleet_scaling_metric_type.py +14 -0
  218. capo_codebuild/types/fleet_scaling_type.py +14 -0
  219. capo_codebuild/types/fleet_sort_by_type.py +18 -0
  220. capo_codebuild/types/fleet_status.py +64 -0
  221. capo_codebuild/types/fleet_status_code.py +23 -0
  222. capo_codebuild/types/fleets.py +29 -0
  223. capo_codebuild/types/fleets_allowed.py +17 -0
  224. capo_codebuild/types/get_report_group_trend_input.py +60 -0
  225. capo_codebuild/types/get_report_group_trend_output.py +63 -0
  226. capo_codebuild/types/get_resource_policy_input.py +31 -0
  227. capo_codebuild/types/get_resource_policy_output.py +28 -0
  228. capo_codebuild/types/git_clone_depth.py +5 -0
  229. capo_codebuild/types/git_submodules_config.py +31 -0
  230. capo_codebuild/types/identifiers.py +17 -0
  231. capo_codebuild/types/image_pull_credentials_type.py +17 -0
  232. capo_codebuild/types/image_versions.py +17 -0
  233. capo_codebuild/types/import_source_credentials_input.py +77 -0
  234. capo_codebuild/types/import_source_credentials_output.py +28 -0
  235. capo_codebuild/types/invalidate_project_cache_input.py +31 -0
  236. capo_codebuild/types/invalidate_project_cache_output.py +18 -0
  237. capo_codebuild/types/key_input.py +5 -0
  238. capo_codebuild/types/language_type.py +25 -0
  239. capo_codebuild/types/list_build_batches_for_project_input.py +76 -0
  240. capo_codebuild/types/list_build_batches_for_project_output.py +43 -0
  241. capo_codebuild/types/list_build_batches_input.py +69 -0
  242. capo_codebuild/types/list_build_batches_output.py +43 -0
  243. capo_codebuild/types/list_builds_for_project_input.py +55 -0
  244. capo_codebuild/types/list_builds_for_project_output.py +41 -0
  245. capo_codebuild/types/list_builds_input.py +45 -0
  246. capo_codebuild/types/list_builds_output.py +41 -0
  247. capo_codebuild/types/list_command_executions_for_sandbox_input.py +64 -0
  248. capo_codebuild/types/list_command_executions_for_sandbox_output.py +49 -0
  249. capo_codebuild/types/list_curated_environment_images_input.py +18 -0
  250. capo_codebuild/types/list_curated_environment_images_output.py +42 -0
  251. capo_codebuild/types/list_fleets_input.py +69 -0
  252. capo_codebuild/types/list_fleets_output.py +43 -0
  253. capo_codebuild/types/list_projects_input.py +64 -0
  254. capo_codebuild/types/list_projects_output.py +43 -0
  255. capo_codebuild/types/list_report_groups_input.py +73 -0
  256. capo_codebuild/types/list_report_groups_output.py +47 -0
  257. capo_codebuild/types/list_reports_for_report_group_input.py +78 -0
  258. capo_codebuild/types/list_reports_for_report_group_output.py +43 -0
  259. capo_codebuild/types/list_reports_input.py +67 -0
  260. capo_codebuild/types/list_reports_output.py +43 -0
  261. capo_codebuild/types/list_sandboxes_for_project_input.py +62 -0
  262. capo_codebuild/types/list_sandboxes_for_project_output.py +43 -0
  263. capo_codebuild/types/list_sandboxes_input.py +52 -0
  264. capo_codebuild/types/list_sandboxes_output.py +43 -0
  265. capo_codebuild/types/list_shared_projects_input.py +73 -0
  266. capo_codebuild/types/list_shared_projects_output.py +43 -0
  267. capo_codebuild/types/list_shared_report_groups_input.py +73 -0
  268. capo_codebuild/types/list_shared_report_groups_output.py +47 -0
  269. capo_codebuild/types/list_source_credentials_input.py +18 -0
  270. capo_codebuild/types/list_source_credentials_output.py +42 -0
  271. capo_codebuild/types/logs_config.py +57 -0
  272. capo_codebuild/types/logs_config_status_type.py +17 -0
  273. capo_codebuild/types/logs_location.py +94 -0
  274. capo_codebuild/types/machine_type.py +17 -0
  275. capo_codebuild/types/network_interface.py +36 -0
  276. capo_codebuild/types/non_empty_string.py +5 -0
  277. capo_codebuild/types/non_negative_int.py +5 -0
  278. capo_codebuild/types/page_size.py +5 -0
  279. capo_codebuild/types/percentage.py +5 -0
  280. capo_codebuild/types/phase_context.py +34 -0
  281. capo_codebuild/types/phase_contexts.py +29 -0
  282. capo_codebuild/types/platform_type.py +19 -0
  283. capo_codebuild/types/project.py +405 -0
  284. capo_codebuild/types/project_arns.py +17 -0
  285. capo_codebuild/types/project_artifacts.py +141 -0
  286. capo_codebuild/types/project_artifacts_list.py +33 -0
  287. capo_codebuild/types/project_badge.py +36 -0
  288. capo_codebuild/types/project_build_batch_config.py +86 -0
  289. capo_codebuild/types/project_cache.py +67 -0
  290. capo_codebuild/types/project_cache_modes.py +29 -0
  291. capo_codebuild/types/project_description.py +5 -0
  292. capo_codebuild/types/project_environment.py +195 -0
  293. capo_codebuild/types/project_file_system_location.py +61 -0
  294. capo_codebuild/types/project_file_system_locations.py +39 -0
  295. capo_codebuild/types/project_fleet.py +28 -0
  296. capo_codebuild/types/project_name.py +5 -0
  297. capo_codebuild/types/project_names.py +17 -0
  298. capo_codebuild/types/project_secondary_source_versions.py +35 -0
  299. capo_codebuild/types/project_sort_by_type.py +18 -0
  300. capo_codebuild/types/project_source.py +135 -0
  301. capo_codebuild/types/project_source_version.py +38 -0
  302. capo_codebuild/types/project_sources.py +29 -0
  303. capo_codebuild/types/project_visibility_type.py +18 -0
  304. capo_codebuild/types/projects.py +29 -0
  305. capo_codebuild/types/proxy_configuration.py +63 -0
  306. capo_codebuild/types/pull_request_build_approver_role.py +29 -0
  307. capo_codebuild/types/pull_request_build_approver_roles.py +39 -0
  308. capo_codebuild/types/pull_request_build_comment_approval.py +18 -0
  309. capo_codebuild/types/pull_request_build_policy.py +66 -0
  310. capo_codebuild/types/put_resource_policy_input.py +38 -0
  311. capo_codebuild/types/put_resource_policy_output.py +28 -0
  312. capo_codebuild/types/registry_credential.py +53 -0
  313. capo_codebuild/types/report.py +180 -0
  314. capo_codebuild/types/report_arns.py +17 -0
  315. capo_codebuild/types/report_code_coverage_sort_by_type.py +17 -0
  316. capo_codebuild/types/report_export_config.py +63 -0
  317. capo_codebuild/types/report_export_config_type.py +17 -0
  318. capo_codebuild/types/report_filter.py +38 -0
  319. capo_codebuild/types/report_group.py +136 -0
  320. capo_codebuild/types/report_group_arns.py +19 -0
  321. capo_codebuild/types/report_group_name.py +5 -0
  322. capo_codebuild/types/report_group_sort_by_type.py +18 -0
  323. capo_codebuild/types/report_group_status_type.py +17 -0
  324. capo_codebuild/types/report_group_trend_field_type.py +24 -0
  325. capo_codebuild/types/report_group_trend_raw_data_list.py +35 -0
  326. capo_codebuild/types/report_group_trend_stats.py +40 -0
  327. capo_codebuild/types/report_groups.py +29 -0
  328. capo_codebuild/types/report_packaging_type.py +17 -0
  329. capo_codebuild/types/report_status_counts.py +28 -0
  330. capo_codebuild/types/report_status_type.py +20 -0
  331. capo_codebuild/types/report_type.py +17 -0
  332. capo_codebuild/types/report_with_raw_data.py +35 -0
  333. capo_codebuild/types/reports.py +29 -0
  334. capo_codebuild/types/resolved_artifact.py +49 -0
  335. capo_codebuild/types/resolved_secondary_artifacts.py +33 -0
  336. capo_codebuild/types/retry_build_batch_input.py +56 -0
  337. capo_codebuild/types/retry_build_batch_output.py +35 -0
  338. capo_codebuild/types/retry_build_batch_type.py +17 -0
  339. capo_codebuild/types/retry_build_input.py +35 -0
  340. capo_codebuild/types/retry_build_output.py +33 -0
  341. capo_codebuild/types/s3_logs_config.py +77 -0
  342. capo_codebuild/types/s3_report_export_config.py +77 -0
  343. capo_codebuild/types/sandbox.py +267 -0
  344. capo_codebuild/types/sandbox_ids.py +17 -0
  345. capo_codebuild/types/sandbox_session.py +133 -0
  346. capo_codebuild/types/sandbox_session_phase.py +94 -0
  347. capo_codebuild/types/sandbox_session_phases.py +35 -0
  348. capo_codebuild/types/sandboxes.py +29 -0
  349. capo_codebuild/types/scaling_configuration_input.py +70 -0
  350. capo_codebuild/types/scaling_configuration_output.py +76 -0
  351. capo_codebuild/types/scope_configuration.py +53 -0
  352. capo_codebuild/types/security_group_ids.py +19 -0
  353. capo_codebuild/types/sensitive_non_empty_string.py +5 -0
  354. capo_codebuild/types/sensitive_string.py +5 -0
  355. capo_codebuild/types/server_type.py +20 -0
  356. capo_codebuild/types/shared_resource_sort_by_type.py +17 -0
  357. capo_codebuild/types/sort_order_type.py +17 -0
  358. capo_codebuild/types/source_auth.py +46 -0
  359. capo_codebuild/types/source_auth_type.py +18 -0
  360. capo_codebuild/types/source_credentials_info.py +65 -0
  361. capo_codebuild/types/source_credentials_infos.py +35 -0
  362. capo_codebuild/types/source_type.py +24 -0
  363. capo_codebuild/types/ssm_session.py +40 -0
  364. capo_codebuild/types/start_build_batch_input.py +459 -0
  365. capo_codebuild/types/start_build_batch_output.py +36 -0
  366. capo_codebuild/types/start_build_input.py +481 -0
  367. capo_codebuild/types/start_build_output.py +34 -0
  368. capo_codebuild/types/start_command_execution_input.py +54 -0
  369. capo_codebuild/types/start_command_execution_output.py +42 -0
  370. capo_codebuild/types/start_sandbox_connection_input.py +31 -0
  371. capo_codebuild/types/start_sandbox_connection_output.py +36 -0
  372. capo_codebuild/types/start_sandbox_input.py +37 -0
  373. capo_codebuild/types/start_sandbox_output.py +36 -0
  374. capo_codebuild/types/status_type.py +21 -0
  375. capo_codebuild/types/stop_build_batch_input.py +31 -0
  376. capo_codebuild/types/stop_build_batch_output.py +35 -0
  377. capo_codebuild/types/stop_build_input.py +31 -0
  378. capo_codebuild/types/stop_build_output.py +34 -0
  379. capo_codebuild/types/stop_sandbox_input.py +31 -0
  380. capo_codebuild/types/stop_sandbox_output.py +36 -0
  381. capo_codebuild/types/string.py +5 -0
  382. capo_codebuild/types/subnets.py +17 -0
  383. capo_codebuild/types/tag.py +35 -0
  384. capo_codebuild/types/tag_list.py +29 -0
  385. capo_codebuild/types/target_tracking_scaling_configuration.py +57 -0
  386. capo_codebuild/types/target_tracking_scaling_configurations.py +39 -0
  387. capo_codebuild/types/test_case.py +89 -0
  388. capo_codebuild/types/test_case_filter.py +34 -0
  389. capo_codebuild/types/test_cases.py +29 -0
  390. capo_codebuild/types/test_report_summary.py +61 -0
  391. capo_codebuild/types/time_out.py +5 -0
  392. capo_codebuild/types/timestamp.py +20 -0
  393. capo_codebuild/types/update_fleet_input.py +203 -0
  394. capo_codebuild/types/update_fleet_output.py +34 -0
  395. capo_codebuild/types/update_project_input.py +312 -0
  396. capo_codebuild/types/update_project_output.py +36 -0
  397. capo_codebuild/types/update_project_visibility_input.py +62 -0
  398. capo_codebuild/types/update_project_visibility_output.py +56 -0
  399. capo_codebuild/types/update_report_group_input.py +67 -0
  400. capo_codebuild/types/update_report_group_output.py +38 -0
  401. capo_codebuild/types/update_webhook_input.py +103 -0
  402. capo_codebuild/types/update_webhook_output.py +36 -0
  403. capo_codebuild/types/value_input.py +5 -0
  404. capo_codebuild/types/vpc_config.py +64 -0
  405. capo_codebuild/types/webhook.py +171 -0
  406. capo_codebuild/types/webhook_build_type.py +18 -0
  407. capo_codebuild/types/webhook_filter.py +56 -0
  408. capo_codebuild/types/webhook_filter_type.py +26 -0
  409. capo_codebuild/types/webhook_scope_type.py +18 -0
  410. capo_codebuild/types/webhook_status.py +19 -0
  411. capo_codebuild/types/wrapper_boolean.py +5 -0
  412. capo_codebuild/types/wrapper_double.py +5 -0
  413. capo_codebuild/types/wrapper_int.py +5 -0
  414. capo_codebuild/types/wrapper_long.py +5 -0
  415. capo_codebuild-0.1.0.dist-info/METADATA +101 -0
  416. capo_codebuild-0.1.0.dist-info/RECORD +419 -0
  417. capo_codebuild-0.1.0.dist-info/WHEEL +5 -0
  418. capo_codebuild-0.1.0.dist-info/licenses/LICENSE +21 -0
  419. capo_codebuild-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,93 @@
1
+ """Shared service-error runtime.
2
+
3
+ Hand-written, not regenerated. Helpers for extracting error metadata
4
+ from HTTP error responses.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from typing import TYPE_CHECKING
10
+
11
+ from zapros import Response
12
+
13
+ from .xml import fromstring
14
+
15
+ if TYPE_CHECKING:
16
+ from xml.etree.ElementTree import Element
17
+
18
+
19
+ def find_error_element(root: Element) -> Element:
20
+ """Return the element holding the error structure's members.
21
+
22
+ Handles the three XML error envelopes: a bare ``<Error>`` root
23
+ (restXml with ``noErrorWrapping``), an ``<ErrorResponse><Error>``
24
+ wrapper (restXml/awsQuery), and the ec2Query
25
+ ``<Response><Errors><Error>`` envelope. Falls back to ``root``
26
+ when no ``<Error>`` element is found.
27
+ """
28
+ if root.tag.endswith("Error"):
29
+ return root
30
+ for path in ("Error", "Errors/Error"):
31
+ err = root.find(path)
32
+ if err is not None:
33
+ return err
34
+ return root
35
+
36
+
37
+ def parse_error_metadata(root: Element) -> tuple[str | None, str | None]:
38
+ """Return ``(code, message)`` from an XML error envelope.
39
+
40
+ Accepts any envelope understood by :func:`find_error_element`.
41
+ Missing children yield ``None``.
42
+ """
43
+ err = find_error_element(root)
44
+ code_el = err.find("Code")
45
+ msg_el = err.find("Message")
46
+ code = code_el.text if code_el is not None else None
47
+ message = msg_el.text if msg_el is not None else None
48
+ return code, message
49
+
50
+
51
+ def parse_error_metadata_json(
52
+ response: Response, data: dict
53
+ ) -> tuple[str | None, str | None]:
54
+ """Return ``(code, message)`` from a restJson1 error response.
55
+
56
+ Code precedence: the ``X-Amzn-Errortype`` response header, then the
57
+ ``__type`` body field, then ``code``. The raw value is normalized by
58
+ dropping a trailing ``:uri`` suffix first, then a ``prefix#``
59
+ namespace — in that order, so a ``#`` inside the uri suffix cannot
60
+ hijack the code. Message comes from ``message`` or ``Message``.
61
+ Missing values yield ``None``.
62
+ """
63
+ code = (
64
+ response.headers.get("X-Amzn-Errortype")
65
+ or data.get("__type")
66
+ or data.get("code")
67
+ )
68
+ if code is not None:
69
+ code = code.split(":", 1)[0].rsplit("#", 1)[-1]
70
+ message = data.get("message") or data.get("Message")
71
+ return code, message
72
+
73
+
74
+ def is_xml_error_body(body: bytes) -> bool:
75
+ """Whether a 2xx response body is really an XML error document.
76
+
77
+ S3 answers CopyObject, UploadPartCopy and CompleteMultipartUpload
78
+ with ``200 OK`` before the operation finishes; a failure after that
79
+ point is reported as an ``<Error>`` body (or an empty body) on the
80
+ 200 response. Official SDKs check the body for exactly these
81
+ operations.
82
+ """
83
+ if not body:
84
+ return True
85
+ return fromstring(body).tag == "Error"
86
+
87
+
88
+ __all__ = [
89
+ "find_error_element",
90
+ "is_xml_error_body",
91
+ "parse_error_metadata",
92
+ "parse_error_metadata_json",
93
+ ]
@@ -0,0 +1,238 @@
1
+ """Shared Amazon eventstream binary-format runtime.
2
+
3
+ Hand-written, not regenerated. Provides framing, header encoding, and
4
+ checksum validation for Smithy event-stream messages.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import datetime
10
+ import uuid
11
+ import zlib
12
+ from collections.abc import AsyncIterator, Callable, Iterator
13
+ from dataclasses import dataclass, field
14
+ from typing import TypeVar, Union
15
+
16
+ HeaderValue = Union[bool, int, bytes, str, datetime.datetime, uuid.UUID]
17
+ T = TypeVar("T")
18
+
19
+
20
+ # Header type constants from the Amazon eventstream specification.
21
+ _TRUE_HEADER = 0x00
22
+ _FALSE_HEADER = 0x01
23
+ _BYTE_HEADER = 0x02
24
+ _SHORT_HEADER = 0x03
25
+ _INTEGER_HEADER = 0x04
26
+ _LONG_HEADER = 0x05
27
+ _BYTE_ARRAY_HEADER = 0x06
28
+ _STRING_HEADER = 0x07
29
+ _TIMESTAMP_HEADER = 0x08
30
+ _UUID_HEADER = 0x09
31
+
32
+
33
+ def _encode_header_value(value: HeaderValue) -> bytes:
34
+ if isinstance(value, bool):
35
+ return bytes([_TRUE_HEADER if value else _FALSE_HEADER])
36
+ if isinstance(value, int):
37
+ if -128 <= value <= 127:
38
+ return bytes([_BYTE_HEADER]) + value.to_bytes(1, "big", signed=True)
39
+ if -32768 <= value <= 32767:
40
+ return bytes([_SHORT_HEADER]) + value.to_bytes(2, "big", signed=True)
41
+ if -2147483648 <= value <= 2147483647:
42
+ return bytes([_INTEGER_HEADER]) + value.to_bytes(4, "big", signed=True)
43
+ # Fall through to signed 64-bit.
44
+ return bytes([_LONG_HEADER]) + value.to_bytes(8, "big", signed=True)
45
+ if isinstance(value, bytes):
46
+ return bytes([_BYTE_ARRAY_HEADER]) + len(value).to_bytes(2, "big") + value
47
+ if isinstance(value, str):
48
+ encoded = value.encode("utf-8")
49
+ return bytes([_STRING_HEADER]) + len(encoded).to_bytes(2, "big") + encoded
50
+ if isinstance(value, datetime.datetime):
51
+ millis = int(value.timestamp() * 1000)
52
+ return bytes([_TIMESTAMP_HEADER]) + millis.to_bytes(8, "big", signed=True)
53
+ if isinstance(value, uuid.UUID):
54
+ return bytes([_UUID_HEADER]) + value.bytes
55
+ raise TypeError(f"unsupported eventstream header value: {value!r}")
56
+
57
+
58
+ def _decode_header_value(
59
+ type_byte: int, data: bytes | bytearray, pos: int
60
+ ) -> tuple[HeaderValue, int]:
61
+ if type_byte == _TRUE_HEADER:
62
+ return True, pos
63
+ if type_byte == _FALSE_HEADER:
64
+ return False, pos
65
+ if type_byte == _BYTE_HEADER:
66
+ return int.from_bytes(data[pos : pos + 1], "big", signed=True), pos + 1
67
+ if type_byte == _SHORT_HEADER:
68
+ return int.from_bytes(data[pos : pos + 2], "big", signed=True), pos + 2
69
+ if type_byte == _INTEGER_HEADER:
70
+ return int.from_bytes(data[pos : pos + 4], "big", signed=True), pos + 4
71
+ if type_byte == _LONG_HEADER:
72
+ return int.from_bytes(data[pos : pos + 8], "big", signed=True), pos + 8
73
+ if type_byte == _BYTE_ARRAY_HEADER:
74
+ length = int.from_bytes(data[pos : pos + 2], "big")
75
+ pos += 2
76
+ return bytes(data[pos : pos + length]), pos + length
77
+ if type_byte == _STRING_HEADER:
78
+ length = int.from_bytes(data[pos : pos + 2], "big")
79
+ pos += 2
80
+ return data[pos : pos + length].decode("utf-8"), pos + length
81
+ if type_byte == _TIMESTAMP_HEADER:
82
+ millis = int.from_bytes(data[pos : pos + 8], "big", signed=True)
83
+ return (
84
+ datetime.datetime.fromtimestamp(millis / 1000, tz=datetime.timezone.utc),
85
+ pos + 8,
86
+ )
87
+ if type_byte == _UUID_HEADER:
88
+ return uuid.UUID(bytes=bytes(data[pos : pos + 16])), pos + 16
89
+ raise ValueError(f"unsupported eventstream header type: {type_byte:#x}")
90
+
91
+
92
+ def _encode_headers(headers: dict[str, HeaderValue]) -> bytes:
93
+ parts: list[bytes] = []
94
+ for name, value in headers.items():
95
+ name_bytes = name.encode("utf-8")
96
+ if len(name_bytes) > 255:
97
+ raise ValueError(f"eventstream header name too long: {name!r}")
98
+ parts.append(bytes([len(name_bytes)]) + name_bytes)
99
+ parts.append(_encode_header_value(value))
100
+ return b"".join(parts)
101
+
102
+
103
+ def _decode_headers(data: bytes | bytearray) -> dict[str, HeaderValue]:
104
+ pos = 0
105
+ headers: dict[str, HeaderValue] = {}
106
+ while pos < len(data):
107
+ name_len = data[pos]
108
+ pos += 1
109
+ name = data[pos : pos + name_len].decode("utf-8")
110
+ pos += name_len
111
+ type_byte = data[pos]
112
+ pos += 1
113
+ value, pos = _decode_header_value(type_byte, data, pos)
114
+ headers[name] = value
115
+ return headers
116
+
117
+
118
+ @dataclass
119
+ class Message:
120
+ """A single Amazon eventstream message."""
121
+
122
+ headers: dict[str, HeaderValue] = field(default_factory=dict)
123
+ payload: bytes = b""
124
+
125
+ def encode(self) -> bytes:
126
+ """Serialize this message into eventstream framing bytes."""
127
+ headers_bytes = _encode_headers(self.headers)
128
+ headers_length = len(headers_bytes)
129
+ payload = self.payload
130
+ total_length = 12 + headers_length + len(payload)
131
+
132
+ prelude = total_length.to_bytes(4, "big") + headers_length.to_bytes(4, "big")
133
+ prelude_crc = zlib.crc32(prelude).to_bytes(4, "big")
134
+ message_body = prelude + prelude_crc + headers_bytes + payload
135
+ message_crc = zlib.crc32(message_body).to_bytes(4, "big")
136
+ return message_body + message_crc
137
+
138
+
139
+ @dataclass
140
+ class MessageDecoder:
141
+ """Stateful decoder that turns byte chunks into :class:`Message` objects.
142
+
143
+ ``feed`` may emit zero, one, or many messages for each chunk. Partial
144
+ frames are buffered until the next chunk completes them.
145
+ """
146
+
147
+ _buffer: bytearray = field(default_factory=bytearray, init=False)
148
+
149
+ def feed(self, data: bytes) -> Iterator[Message]:
150
+ """Append ``data`` to the internal buffer and yield any full messages."""
151
+ self._buffer.extend(data)
152
+ while True:
153
+ if len(self._buffer) < 12:
154
+ return
155
+
156
+ total_length = int.from_bytes(self._buffer[:4], "big")
157
+ headers_length = int.from_bytes(self._buffer[4:8], "big")
158
+ prelude = bytes(self._buffer[:8])
159
+ prelude_crc = int.from_bytes(self._buffer[8:12], "big")
160
+
161
+ if total_length < 12 + headers_length:
162
+ raise ValueError(
163
+ f"invalid eventstream message: total_length={total_length} "
164
+ f"is smaller than minimum {12 + headers_length}"
165
+ )
166
+
167
+ message_end = total_length + 4
168
+ if len(self._buffer) < message_end:
169
+ return
170
+
171
+ computed_prelude_crc = zlib.crc32(prelude) & 0xFFFFFFFF
172
+ if computed_prelude_crc != prelude_crc:
173
+ raise ValueError("eventstream prelude checksum mismatch")
174
+
175
+ message_bytes = bytes(self._buffer[:total_length])
176
+ message_crc = int.from_bytes(
177
+ self._buffer[total_length : total_length + 4], "big"
178
+ )
179
+ computed_message_crc = zlib.crc32(message_bytes) & 0xFFFFFFFF
180
+ if computed_message_crc != message_crc:
181
+ raise ValueError("eventstream message checksum mismatch")
182
+
183
+ headers = _decode_headers(self._buffer[12 : 12 + headers_length])
184
+ payload = bytes(self._buffer[12 + headers_length : total_length])
185
+ del self._buffer[:message_end]
186
+ yield Message(headers=headers, payload=payload)
187
+
188
+
189
+ def raw_stream_to_events(
190
+ raw_stream: Iterator[bytes], decoder: MessageDecoder, deser: Callable[[Message], T]
191
+ ) -> Iterator[T]:
192
+ """Map a raw byte iterator into deserialized event objects."""
193
+ for chunk in raw_stream:
194
+ for message in decoder.feed(chunk):
195
+ yield deser(message)
196
+
197
+
198
+ async def async_raw_stream_to_events(
199
+ raw_stream: AsyncIterator[bytes],
200
+ decoder: MessageDecoder,
201
+ deser: Callable[[Message], T],
202
+ ) -> AsyncIterator[T]:
203
+ """Map an async raw byte iterator into deserialized event objects."""
204
+ async for chunk in raw_stream:
205
+ for message in decoder.feed(chunk):
206
+ yield deser(message)
207
+
208
+
209
+ def read_messages(
210
+ raw_stream: Iterator[bytes], decoder: MessageDecoder
211
+ ) -> Iterator[Message]:
212
+ """Yield :class:`Message` objects framed out of a raw byte iterator.
213
+
214
+ Used by RPC event streams (e.g. awsJson) where the first message may be an
215
+ initial-response that must be pulled off before consuming the events.
216
+ """
217
+ for chunk in raw_stream:
218
+ yield from decoder.feed(chunk)
219
+
220
+
221
+ async def async_read_messages(
222
+ raw_stream: AsyncIterator[bytes], decoder: MessageDecoder
223
+ ) -> AsyncIterator[Message]:
224
+ """Async variant of :func:`read_messages`."""
225
+ async for chunk in raw_stream:
226
+ for message in decoder.feed(chunk):
227
+ yield message
228
+
229
+
230
+ __all__ = [
231
+ "HeaderValue",
232
+ "Message",
233
+ "MessageDecoder",
234
+ "async_raw_stream_to_events",
235
+ "async_read_messages",
236
+ "raw_stream_to_events",
237
+ "read_messages",
238
+ ]
@@ -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
+ ]
File without changes
@@ -0,0 +1,160 @@
1
+ """AWS partitions table and ``aws.partition`` rules-engine function.
2
+
3
+ Data sourced from AWS SDK ``partitions.json``. All dispatch tables are
4
+ materialised at codegen time:
5
+
6
+ * ``_REGION_LOOKUP`` — O(1) dict of explicit region name -> partition outputs.
7
+ * ``_REGEX_LOOKUP`` — compiled-regex / outputs pairs for unknown regions.
8
+ * ``_DEFAULT_OUTPUTS`` — fallback partition (``aws``)."""
9
+
10
+ from __future__ import annotations
11
+
12
+ import re
13
+ from typing import Any
14
+
15
+ _PARTITION_AWS: dict[str, Any] = {
16
+ "dnsSuffix": "amazonaws.com",
17
+ "dualStackDnsSuffix": "api.aws",
18
+ "implicitGlobalRegion": "us-east-1",
19
+ "name": "aws",
20
+ "supportsDualStack": True,
21
+ "supportsFIPS": True,
22
+ }
23
+ _PARTITION_AWS_CN: dict[str, Any] = {
24
+ "dnsSuffix": "amazonaws.com.cn",
25
+ "dualStackDnsSuffix": "api.amazonwebservices.com.cn",
26
+ "implicitGlobalRegion": "cn-northwest-1",
27
+ "name": "aws-cn",
28
+ "supportsDualStack": True,
29
+ "supportsFIPS": True,
30
+ }
31
+ _PARTITION_AWS_EUSC: dict[str, Any] = {
32
+ "dnsSuffix": "amazonaws.eu",
33
+ "dualStackDnsSuffix": "api.amazonwebservices.eu",
34
+ "implicitGlobalRegion": "eusc-de-east-1",
35
+ "name": "aws-eusc",
36
+ "supportsDualStack": True,
37
+ "supportsFIPS": True,
38
+ }
39
+ _PARTITION_AWS_ISO: dict[str, Any] = {
40
+ "dnsSuffix": "c2s.ic.gov",
41
+ "dualStackDnsSuffix": "api.aws.ic.gov",
42
+ "implicitGlobalRegion": "us-iso-east-1",
43
+ "name": "aws-iso",
44
+ "supportsDualStack": True,
45
+ "supportsFIPS": True,
46
+ }
47
+ _PARTITION_AWS_ISO_B: dict[str, Any] = {
48
+ "dnsSuffix": "sc2s.sgov.gov",
49
+ "dualStackDnsSuffix": "api.aws.scloud",
50
+ "implicitGlobalRegion": "us-isob-east-1",
51
+ "name": "aws-iso-b",
52
+ "supportsDualStack": True,
53
+ "supportsFIPS": True,
54
+ }
55
+ _PARTITION_AWS_ISO_E: dict[str, Any] = {
56
+ "dnsSuffix": "cloud.adc-e.uk",
57
+ "dualStackDnsSuffix": "api.cloud-aws.adc-e.uk",
58
+ "implicitGlobalRegion": "eu-isoe-west-1",
59
+ "name": "aws-iso-e",
60
+ "supportsDualStack": True,
61
+ "supportsFIPS": True,
62
+ }
63
+ _PARTITION_AWS_ISO_F: dict[str, Any] = {
64
+ "dnsSuffix": "csp.hci.ic.gov",
65
+ "dualStackDnsSuffix": "api.aws.hci.ic.gov",
66
+ "implicitGlobalRegion": "us-isof-south-1",
67
+ "name": "aws-iso-f",
68
+ "supportsDualStack": True,
69
+ "supportsFIPS": True,
70
+ }
71
+ _PARTITION_AWS_US_GOV: dict[str, Any] = {
72
+ "dnsSuffix": "amazonaws.com",
73
+ "dualStackDnsSuffix": "api.aws",
74
+ "implicitGlobalRegion": "us-gov-west-1",
75
+ "name": "aws-us-gov",
76
+ "supportsDualStack": True,
77
+ "supportsFIPS": True,
78
+ }
79
+
80
+ _REGION_LOOKUP: dict[str, dict[str, Any]] = {
81
+ "af-south-1": _PARTITION_AWS,
82
+ "ap-east-1": _PARTITION_AWS,
83
+ "ap-east-2": _PARTITION_AWS,
84
+ "ap-northeast-1": _PARTITION_AWS,
85
+ "ap-northeast-2": _PARTITION_AWS,
86
+ "ap-northeast-3": _PARTITION_AWS,
87
+ "ap-south-1": _PARTITION_AWS,
88
+ "ap-south-2": _PARTITION_AWS,
89
+ "ap-southeast-1": _PARTITION_AWS,
90
+ "ap-southeast-2": _PARTITION_AWS,
91
+ "ap-southeast-3": _PARTITION_AWS,
92
+ "ap-southeast-4": _PARTITION_AWS,
93
+ "ap-southeast-5": _PARTITION_AWS,
94
+ "ap-southeast-6": _PARTITION_AWS,
95
+ "ap-southeast-7": _PARTITION_AWS,
96
+ "aws-global": _PARTITION_AWS,
97
+ "ca-central-1": _PARTITION_AWS,
98
+ "ca-west-1": _PARTITION_AWS,
99
+ "eu-central-1": _PARTITION_AWS,
100
+ "eu-central-2": _PARTITION_AWS,
101
+ "eu-north-1": _PARTITION_AWS,
102
+ "eu-south-1": _PARTITION_AWS,
103
+ "eu-south-2": _PARTITION_AWS,
104
+ "eu-west-1": _PARTITION_AWS,
105
+ "eu-west-2": _PARTITION_AWS,
106
+ "eu-west-3": _PARTITION_AWS,
107
+ "il-central-1": _PARTITION_AWS,
108
+ "me-central-1": _PARTITION_AWS,
109
+ "me-south-1": _PARTITION_AWS,
110
+ "mx-central-1": _PARTITION_AWS,
111
+ "sa-east-1": _PARTITION_AWS,
112
+ "us-east-1": _PARTITION_AWS,
113
+ "us-east-2": _PARTITION_AWS,
114
+ "us-west-1": _PARTITION_AWS,
115
+ "us-west-2": _PARTITION_AWS,
116
+ "aws-cn-global": _PARTITION_AWS_CN,
117
+ "cn-north-1": _PARTITION_AWS_CN,
118
+ "cn-northwest-1": _PARTITION_AWS_CN,
119
+ "eusc-de-east-1": _PARTITION_AWS_EUSC,
120
+ "aws-iso-global": _PARTITION_AWS_ISO,
121
+ "us-iso-east-1": _PARTITION_AWS_ISO,
122
+ "us-iso-west-1": _PARTITION_AWS_ISO,
123
+ "aws-iso-b-global": _PARTITION_AWS_ISO_B,
124
+ "us-isob-east-1": _PARTITION_AWS_ISO_B,
125
+ "us-isob-west-1": _PARTITION_AWS_ISO_B,
126
+ "aws-iso-e-global": _PARTITION_AWS_ISO_E,
127
+ "eu-isoe-west-1": _PARTITION_AWS_ISO_E,
128
+ "aws-iso-f-global": _PARTITION_AWS_ISO_F,
129
+ "us-isof-east-1": _PARTITION_AWS_ISO_F,
130
+ "us-isof-south-1": _PARTITION_AWS_ISO_F,
131
+ "aws-us-gov-global": _PARTITION_AWS_US_GOV,
132
+ "us-gov-east-1": _PARTITION_AWS_US_GOV,
133
+ "us-gov-west-1": _PARTITION_AWS_US_GOV,
134
+ }
135
+
136
+ _REGEX_LOOKUP: tuple[tuple[re.Pattern[str], dict[str, Any]], ...] = (
137
+ (re.compile(r"^(us|eu|ap|sa|ca|me|af|il|mx)\-\w+\-\d+$"), _PARTITION_AWS),
138
+ (re.compile(r"^cn\-\w+\-\d+$"), _PARTITION_AWS_CN),
139
+ (re.compile(r"^eusc\-(de)\-\w+\-\d+$"), _PARTITION_AWS_EUSC),
140
+ (re.compile(r"^us\-iso\-\w+\-\d+$"), _PARTITION_AWS_ISO),
141
+ (re.compile(r"^us\-isob\-\w+\-\d+$"), _PARTITION_AWS_ISO_B),
142
+ (re.compile(r"^eu\-isoe\-\w+\-\d+$"), _PARTITION_AWS_ISO_E),
143
+ (re.compile(r"^us\-isof\-\w+\-\d+$"), _PARTITION_AWS_ISO_F),
144
+ (re.compile(r"^us\-gov\-\w+\-\d+$"), _PARTITION_AWS_US_GOV),
145
+ )
146
+
147
+ _DEFAULT_OUTPUTS: dict[str, Any] = _PARTITION_AWS
148
+
149
+
150
+ def aws_partition(region: Any) -> dict[str, Any] | None:
151
+ """Resolve ``region`` to a partition outputs dict."""
152
+ if not isinstance(region, str):
153
+ return None
154
+ outputs = _REGION_LOOKUP.get(region)
155
+ if outputs is not None:
156
+ return outputs
157
+ for pattern, outputs in _REGEX_LOOKUP:
158
+ if pattern.fullmatch(region):
159
+ return outputs
160
+ return _DEFAULT_OUTPUTS