capo-codecatalyst 0.1.0__tar.gz → 0.3.0__tar.gz
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.
- {capo_codecatalyst-0.1.0/src/capo_codecatalyst.egg-info → capo_codecatalyst-0.3.0}/PKG-INFO +18 -1
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/README.md +15 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/pyproject.toml +5 -1
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/__init__.py +1 -0
- capo_codecatalyst-0.3.0/src/capo_codecatalyst/_body.py +221 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_services/_pipeline.py +51 -2
- capo_codecatalyst-0.3.0/src/capo_codecatalyst/_services/async_code_catalyst.py +2722 -0
- capo_codecatalyst-0.3.0/src/capo_codecatalyst/_services/code_catalyst.py +2680 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0/src/capo_codecatalyst.egg-info}/PKG-INFO +18 -1
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst.egg-info/SOURCES.txt +2 -0
- capo_codecatalyst-0.3.0/src/capo_codecatalyst.egg-info/requires.txt +4 -0
- capo_codecatalyst-0.3.0/tests/test_body.py +225 -0
- capo_codecatalyst-0.1.0/src/capo_codecatalyst/_services/async_code_catalyst.py +0 -214
- capo_codecatalyst-0.1.0/src/capo_codecatalyst/_services/code_catalyst.py +0 -212
- capo_codecatalyst-0.1.0/src/capo_codecatalyst.egg-info/requires.txt +0 -1
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/LICENSE +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/setup.cfg +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_async.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_auth/_identity.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_auth/_providers.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_auth/_signers.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_auth/_sigv4.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_auth/_zapros_handler.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_iter.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/create_access_token.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/create_dev_environment.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/create_project.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/create_source_repository.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/create_source_repository_branch.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/delete_access_token.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/delete_dev_environment.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/delete_project.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/delete_source_repository.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/delete_space.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/get_dev_environment.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/get_project.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/get_source_repository.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/get_source_repository_clone_urls.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/get_space.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/get_subscription.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/get_user_details.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/get_workflow.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/get_workflow_run.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/list_access_tokens.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/list_dev_environment_sessions.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/list_dev_environments.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/list_event_logs.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/list_projects.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/list_source_repositories.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/list_source_repository_branches.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/list_spaces.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/list_workflow_runs.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/list_workflows.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/start_dev_environment.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/start_dev_environment_session.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/start_workflow_run.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/stop_dev_environment.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/stop_dev_environment_session.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/update_dev_environment.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/update_project.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/update_space.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_operations/code_catalyst/verify_session.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_pagination.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_protocol/__init__.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_protocol/errors.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_protocol/eventstream.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_protocol/serialize.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_protocol/xml.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_resources/code_catalyst/access_token.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_resources/code_catalyst/space.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_rule_engine/__init__.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_rule_engine/_aws_partition.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_rule_engine/_endpoint_rule_set.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_rule_engine/_endpoint_runtime.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_services/_aws_config.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/errors/__init__.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/errors/_base.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/errors/access_denied_exception.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/errors/conflict_exception.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/errors/resource_not_found_exception.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/errors/service_quota_exceeded_exception.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/errors/throttling_exception.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/errors/validation_exception.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/py.typed +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/_prelude/blob.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/_prelude/timestamp.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/access_token_id.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/access_token_name.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/access_token_secret.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/access_token_summaries.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/access_token_summary.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/client_token.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/comparison_operator.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/create_access_token_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/create_access_token_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/create_dev_environment_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/create_dev_environment_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/create_project_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/create_project_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/create_source_repository_branch_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/create_source_repository_branch_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/create_source_repository_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/create_source_repository_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/delete_access_token_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/delete_access_token_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/delete_dev_environment_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/delete_dev_environment_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/delete_project_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/delete_project_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/delete_source_repository_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/delete_source_repository_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/delete_space_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/delete_space_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/dev_environment_access_details.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/dev_environment_repository_summaries.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/dev_environment_repository_summary.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/dev_environment_session_configuration.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/dev_environment_session_summary.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/dev_environment_session_type.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/dev_environment_sessions_summary_list.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/dev_environment_status.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/dev_environment_summary.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/dev_environment_summary_list.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/email_address.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/event_log_entries.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/event_log_entry.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/event_payload.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/execute_command_session_configuration.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/execute_command_session_configuration_arguments.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/filter.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/filter_key.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/filters.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_dev_environment_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_dev_environment_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_project_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_project_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_source_repository_clone_urls_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_source_repository_clone_urls_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_source_repository_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_source_repository_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_space_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_space_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_subscription_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_subscription_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_user_details_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_user_details_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_workflow_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_workflow_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_workflow_run_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/get_workflow_run_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/ide.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/ide_configuration.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/ide_configuration_list.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/ides.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/inactivity_timeout_minutes.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/instance_type.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_access_tokens_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_access_tokens_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_dev_environment_sessions_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_dev_environment_sessions_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_dev_environments_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_dev_environments_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_event_logs_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_event_logs_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_projects_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_projects_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_source_repositories_item.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_source_repositories_items.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_source_repositories_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_source_repositories_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_source_repository_branches_item.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_source_repository_branches_items.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_source_repository_branches_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_source_repository_branches_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_spaces_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_spaces_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_workflow_runs_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_workflow_runs_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_workflows_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/list_workflows_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/name_string.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/operation_type.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/persistent_storage.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/persistent_storage_configuration.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/project_description.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/project_display_name.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/project_information.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/project_list_filter.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/project_list_filters.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/project_summaries.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/project_summary.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/region_string.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/repositories_input.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/repository_input.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/sensitive_string.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/source_repository_branch_ref_string.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/source_repository_branch_string.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/source_repository_description_string.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/source_repository_id_string.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/source_repository_name_string.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/space_description.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/space_summaries.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/space_summary.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/start_dev_environment_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/start_dev_environment_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/start_dev_environment_session_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/start_dev_environment_session_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/start_workflow_run_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/start_workflow_run_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/status_reason.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/stop_dev_environment_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/stop_dev_environment_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/stop_dev_environment_session_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/stop_dev_environment_session_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/string_list.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/timestamp.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/update_dev_environment_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/update_dev_environment_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/update_project_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/update_project_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/update_space_request.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/update_space_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/user_identity.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/user_type.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/uuid.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/verify_session_response.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_definition.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_definition_summary.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_run_mode.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_run_sort_criteria.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_run_sort_criteria_list.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_run_status.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_run_status_reason.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_run_status_reasons.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_run_summaries.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_run_summary.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_sort_criteria.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_sort_criteria_list.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_status.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_summaries.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/types/workflow_summary.py +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst.egg-info/dependency_links.txt +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst.egg-info/top_level.txt +0 -0
- {capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/tests/test_sigv4.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: capo-codecatalyst
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Python SDK for Codecatalyst.
|
|
5
5
|
Classifier: Development Status :: 4 - Beta
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -18,6 +18,8 @@ Requires-Python: >=3.10
|
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
Requires-Dist: zapros>=0.13.0
|
|
21
|
+
Provides-Extra: anyio
|
|
22
|
+
Requires-Dist: anyio>=3.0; extra == "anyio"
|
|
21
23
|
Dynamic: license-file
|
|
22
24
|
|
|
23
25
|
# Getting Started
|
|
@@ -41,6 +43,21 @@ async def main():
|
|
|
41
43
|
print(response["user_id"])
|
|
42
44
|
```
|
|
43
45
|
|
|
46
|
+
## Pagination
|
|
47
|
+
|
|
48
|
+
Some operations in this SDK support pagination. If the operation supports pagination it will have an `iter_` prefixed method that returns an async iterator.
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from capo_codecatalyst import AsyncCodeCatalystClient
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
async def main():
|
|
55
|
+
async with AsyncCodeCatalystClient() as code_catalyst:
|
|
56
|
+
# Example: paginate over list_access_tokens
|
|
57
|
+
async for item in code_catalyst.iter_list_access_tokens():
|
|
58
|
+
print(item)
|
|
59
|
+
```
|
|
60
|
+
|
|
44
61
|
## Error Handling
|
|
45
62
|
|
|
46
63
|
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
|
|
@@ -19,6 +19,21 @@ async def main():
|
|
|
19
19
|
print(response["user_id"])
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
## Pagination
|
|
23
|
+
|
|
24
|
+
Some operations in this SDK support pagination. If the operation supports pagination it will have an `iter_` prefixed method that returns an async iterator.
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from capo_codecatalyst import AsyncCodeCatalystClient
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
async def main():
|
|
31
|
+
async with AsyncCodeCatalystClient() as code_catalyst:
|
|
32
|
+
# Example: paginate over list_access_tokens
|
|
33
|
+
async for item in code_catalyst.iter_list_access_tokens():
|
|
34
|
+
print(item)
|
|
35
|
+
```
|
|
36
|
+
|
|
22
37
|
## Error Handling
|
|
23
38
|
|
|
24
39
|
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "capo-codecatalyst"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.3.0"
|
|
4
4
|
description = "Python SDK for Codecatalyst."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -22,6 +22,10 @@ dependencies = [
|
|
|
22
22
|
"zapros>=0.13.0",
|
|
23
23
|
]
|
|
24
24
|
|
|
25
|
+
[project.optional-dependencies]
|
|
26
|
+
# Async file request bodies via Body.async_from_path
|
|
27
|
+
anyio = ["anyio>=3.0"]
|
|
28
|
+
|
|
25
29
|
[tool.pytest.ini_options]
|
|
26
30
|
pythonpath = ["src"]
|
|
27
31
|
testpaths = ["tests"]
|
|
@@ -27,6 +27,7 @@ from ._auth._providers import (
|
|
|
27
27
|
)
|
|
28
28
|
from ._auth._signers import HttpBearerSigner as HttpBearerSigner
|
|
29
29
|
from ._auth._signers import Signer as Signer
|
|
30
|
+
from ._body import Body as Body
|
|
30
31
|
from ._services._pipeline import (
|
|
31
32
|
AsyncOperationOptions as AsyncOperationOptions,
|
|
32
33
|
)
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"""Request body abstraction for streaming operations.
|
|
2
|
+
|
|
3
|
+
Hand-written, not regenerated.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
from collections.abc import AsyncIterator, Callable, Iterator
|
|
10
|
+
from contextlib import (
|
|
11
|
+
AbstractAsyncContextManager,
|
|
12
|
+
AbstractContextManager,
|
|
13
|
+
asynccontextmanager,
|
|
14
|
+
contextmanager,
|
|
15
|
+
)
|
|
16
|
+
from typing import TYPE_CHECKING, Generic, TypeVar, Union, cast
|
|
17
|
+
|
|
18
|
+
from ._iter import AnyIterator
|
|
19
|
+
|
|
20
|
+
if TYPE_CHECKING:
|
|
21
|
+
import anyio
|
|
22
|
+
else:
|
|
23
|
+
try:
|
|
24
|
+
import anyio
|
|
25
|
+
except ImportError:
|
|
26
|
+
anyio = None
|
|
27
|
+
|
|
28
|
+
_CHUNK_SIZE = 64 * 1024
|
|
29
|
+
|
|
30
|
+
TStream = TypeVar("TStream", Iterator[bytes], AsyncIterator[bytes])
|
|
31
|
+
|
|
32
|
+
# The opener yields the fresh stream together with its length, or ``None`` when
|
|
33
|
+
# no stream could be produced (an exhausted or non-rewindable source, or logic
|
|
34
|
+
# that decides dynamically it cannot reopen). Pairing the length with each open
|
|
35
|
+
# lets it change between rebuilds instead of being fixed for the whole body.
|
|
36
|
+
_ContextManager = Union[
|
|
37
|
+
AbstractContextManager[Union[tuple[TStream, int], None]],
|
|
38
|
+
AbstractAsyncContextManager[Union[tuple[TStream, int], None]],
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class Body(AnyIterator[bytes], Generic[TStream]):
|
|
43
|
+
"""A replayable request body whose length travels with each open.
|
|
44
|
+
|
|
45
|
+
A plain ``Iterator[bytes]`` can be sent only once, so a failed request
|
|
46
|
+
cannot be retried. A ``Body`` instead holds an *opener* — a context manager
|
|
47
|
+
that opens a fresh stream over the same source — and rebuilds the stream
|
|
48
|
+
before every attempt, closing whatever was left of the previous one.
|
|
49
|
+
|
|
50
|
+
``TStream`` is ``Iterator[bytes]`` for bodies built with :meth:`from_path`
|
|
51
|
+
and ``AsyncIterator[bytes]`` for :meth:`async_from_path`; the former use
|
|
52
|
+
``rebuild()``/``close()``, the latter ``arebuild()``/``aclose()``.
|
|
53
|
+
``build_request`` rebuilds before every attempt.
|
|
54
|
+
|
|
55
|
+
Each open produces ``(stream, length)`` together, so the length is not bound
|
|
56
|
+
to the whole body and may differ from one rebuild to the next. A rebuild is
|
|
57
|
+
also not guaranteed to succeed: the source may be exhausted or
|
|
58
|
+
non-rewindable, so the opener can yield ``None`` and :meth:`rebuild` then
|
|
59
|
+
returns ``None`` instead of a pair. Callers check the return value::
|
|
60
|
+
|
|
61
|
+
for attempt in range(max_attempts):
|
|
62
|
+
opened = body.rebuild()
|
|
63
|
+
if opened is None:
|
|
64
|
+
raise RuntimeError("body could not be rebuilt")
|
|
65
|
+
stream, length = opened
|
|
66
|
+
send(stream, length)
|
|
67
|
+
|
|
68
|
+
``length`` also holds the current stream's length as an attribute (``None``
|
|
69
|
+
before the first rebuild). Iterating a ``Body`` reads its current stream.
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
def __init__(self, opener: Callable[[], _ContextManager[TStream]]) -> None:
|
|
73
|
+
self._opener = opener
|
|
74
|
+
self._cm: _ContextManager[TStream] | None = None
|
|
75
|
+
self._stream: TStream | None = None
|
|
76
|
+
self.length: int | None = None
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_path(
|
|
80
|
+
cls, path: str | os.PathLike[str], chunk_size: int = _CHUNK_SIZE
|
|
81
|
+
) -> Body[Iterator[bytes]]:
|
|
82
|
+
"""A body that reads ``path`` in ``chunk_size`` chunks, reopening it (and re-measuring it) on every rebuild."""
|
|
83
|
+
|
|
84
|
+
@contextmanager
|
|
85
|
+
def open_() -> Iterator[tuple[Iterator[bytes], int]]:
|
|
86
|
+
with open(path, "rb") as file:
|
|
87
|
+
length = os.fstat(file.fileno()).st_size
|
|
88
|
+
yield iter(lambda: file.read(chunk_size), b""), length
|
|
89
|
+
|
|
90
|
+
return Body(open_)
|
|
91
|
+
|
|
92
|
+
@classmethod
|
|
93
|
+
def async_from_path(
|
|
94
|
+
cls, path: str | os.PathLike[str], chunk_size: int = _CHUNK_SIZE
|
|
95
|
+
) -> Body[AsyncIterator[bytes]]:
|
|
96
|
+
"""The async counterpart of :meth:`from_path`; needs ``anyio`` installed."""
|
|
97
|
+
if anyio is None:
|
|
98
|
+
dist = (__package__ or "capo").replace("_", "-")
|
|
99
|
+
raise RuntimeError(
|
|
100
|
+
"Body.async_from_path() requires the anyio package; "
|
|
101
|
+
f"reinstall with the anyio feature enabled: {dist}[anyio]"
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
@asynccontextmanager
|
|
105
|
+
async def open_() -> AsyncIterator[tuple[AsyncIterator[bytes], int]]:
|
|
106
|
+
async with await anyio.open_file(path, "rb") as file:
|
|
107
|
+
length = os.fstat(file.wrapped.fileno()).st_size
|
|
108
|
+
|
|
109
|
+
async def chunks() -> AsyncIterator[bytes]:
|
|
110
|
+
while chunk := await file.read(chunk_size):
|
|
111
|
+
yield chunk
|
|
112
|
+
|
|
113
|
+
yield chunks(), length
|
|
114
|
+
|
|
115
|
+
return Body(open_)
|
|
116
|
+
|
|
117
|
+
@property
|
|
118
|
+
def stream(self) -> TStream | None:
|
|
119
|
+
"""The current open stream, or ``None`` if none is open (before the first
|
|
120
|
+
rebuild, or after a close).
|
|
121
|
+
|
|
122
|
+
``build_request`` reuses a non-``None`` stream instead of rebuilding, so
|
|
123
|
+
the retry layer stays in control of when a fresh stream is created.
|
|
124
|
+
"""
|
|
125
|
+
return self._stream
|
|
126
|
+
|
|
127
|
+
def rebuild(self: Body[Iterator[bytes]]) -> tuple[Iterator[bytes], int] | None:
|
|
128
|
+
"""Reopen the stream, closing any previous one, and return ``(stream, length)``.
|
|
129
|
+
|
|
130
|
+
``None`` if the source could not be reopened.
|
|
131
|
+
"""
|
|
132
|
+
self.close()
|
|
133
|
+
cm = self._opener()
|
|
134
|
+
if not isinstance(cm, AbstractContextManager):
|
|
135
|
+
raise TypeError(
|
|
136
|
+
"this Body has an async opener; use it with the async client (arebuild/aclose)"
|
|
137
|
+
)
|
|
138
|
+
cm = cast(AbstractContextManager["tuple[Iterator[bytes], int] | None"], cm)
|
|
139
|
+
opened = cm.__enter__()
|
|
140
|
+
if opened is None:
|
|
141
|
+
cm.__exit__(None, None, None)
|
|
142
|
+
return None
|
|
143
|
+
stream, length = opened
|
|
144
|
+
self._stream, self.length, self._cm = stream, length, cm
|
|
145
|
+
return stream, length
|
|
146
|
+
|
|
147
|
+
async def arebuild(
|
|
148
|
+
self: Body[AsyncIterator[bytes]],
|
|
149
|
+
) -> tuple[AsyncIterator[bytes], int] | None:
|
|
150
|
+
"""Async :meth:`rebuild`, returning ``(stream, length)`` or ``None``."""
|
|
151
|
+
await self.aclose()
|
|
152
|
+
cm = self._opener()
|
|
153
|
+
if not isinstance(cm, AbstractAsyncContextManager):
|
|
154
|
+
raise TypeError(
|
|
155
|
+
"this Body has a sync opener; use it with the sync client (rebuild/close)"
|
|
156
|
+
)
|
|
157
|
+
cm = cast(
|
|
158
|
+
AbstractAsyncContextManager["tuple[AsyncIterator[bytes], int] | None"], cm
|
|
159
|
+
)
|
|
160
|
+
opened = await cm.__aenter__()
|
|
161
|
+
if opened is None:
|
|
162
|
+
await cm.__aexit__(None, None, None)
|
|
163
|
+
return None
|
|
164
|
+
stream, length = opened
|
|
165
|
+
self._stream, self.length, self._cm = stream, length, cm
|
|
166
|
+
return stream, length
|
|
167
|
+
|
|
168
|
+
def close(self: Body[Iterator[bytes]]) -> None:
|
|
169
|
+
cm, self._cm, self._stream, self.length = self._cm, None, None, None
|
|
170
|
+
if cm is not None:
|
|
171
|
+
cast(AbstractContextManager[object], cm).__exit__(None, None, None)
|
|
172
|
+
|
|
173
|
+
async def aclose(self: Body[AsyncIterator[bytes]]) -> None:
|
|
174
|
+
cm, self._cm, self._stream, self.length = self._cm, None, None, None
|
|
175
|
+
if cm is not None:
|
|
176
|
+
await cast(AbstractAsyncContextManager[object], cm).__aexit__(
|
|
177
|
+
None, None, None
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
def __next__(self) -> bytes:
|
|
181
|
+
if self._stream is None:
|
|
182
|
+
raise RuntimeError("body has no open stream; call rebuild() first")
|
|
183
|
+
return next(cast(Iterator[bytes], self._stream))
|
|
184
|
+
|
|
185
|
+
async def __anext__(self) -> bytes:
|
|
186
|
+
if self._stream is None:
|
|
187
|
+
raise RuntimeError("body has no open stream; call rebuild() first")
|
|
188
|
+
return await cast(AsyncIterator[bytes], self._stream).__anext__()
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
@contextmanager
|
|
192
|
+
def closing_bodies(inp: object) -> Iterator[None]:
|
|
193
|
+
"""Close every :class:`Body` in a request input when the operation finishes.
|
|
194
|
+
|
|
195
|
+
The operation method wraps its whole run (request build across retries, plus
|
|
196
|
+
response handling) in this, so a ``Body``'s stream is released once — and only
|
|
197
|
+
once — the operation is done. Non-``Body`` values (bytes, plain iterators,
|
|
198
|
+
``StaticAnyIterator``) are left untouched.
|
|
199
|
+
"""
|
|
200
|
+
try:
|
|
201
|
+
yield
|
|
202
|
+
finally:
|
|
203
|
+
if isinstance(inp, dict):
|
|
204
|
+
for value in inp.values():
|
|
205
|
+
if isinstance(value, Body):
|
|
206
|
+
cast("Body[Iterator[bytes]]", value).close()
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
@asynccontextmanager
|
|
210
|
+
async def aclosing_bodies(inp: object) -> AsyncIterator[None]:
|
|
211
|
+
"""Async :func:`closing_bodies`, awaiting :meth:`Body.aclose`."""
|
|
212
|
+
try:
|
|
213
|
+
yield
|
|
214
|
+
finally:
|
|
215
|
+
if isinstance(inp, dict):
|
|
216
|
+
for value in inp.values():
|
|
217
|
+
if isinstance(value, Body):
|
|
218
|
+
await cast("Body[AsyncIterator[bytes]]", value).aclose()
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
__all__ = ["Body", "aclosing_bodies", "closing_bodies"]
|
{capo_codecatalyst-0.1.0 → capo_codecatalyst-0.3.0}/src/capo_codecatalyst/_services/_pipeline.py
RENAMED
|
@@ -2,20 +2,24 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import random
|
|
4
4
|
import time
|
|
5
|
-
from collections.abc import Sequence
|
|
5
|
+
from collections.abc import AsyncIterator, Iterator, Sequence
|
|
6
6
|
from dataclasses import dataclass
|
|
7
|
-
from typing import TYPE_CHECKING, Awaitable, Callable, Generic, TypeVar
|
|
7
|
+
from typing import TYPE_CHECKING, Awaitable, Callable, Generic, TypeVar, cast
|
|
8
8
|
|
|
9
9
|
from zapros import (
|
|
10
10
|
AsyncClient,
|
|
11
11
|
Client,
|
|
12
12
|
ConnectionError,
|
|
13
|
+
ConnectTimeoutError,
|
|
14
|
+
PoolTimeoutError,
|
|
13
15
|
Response,
|
|
14
16
|
SSLError,
|
|
15
17
|
TimeoutError,
|
|
16
18
|
)
|
|
17
19
|
|
|
18
20
|
from capo_codecatalyst._async import anysleep
|
|
21
|
+
from capo_codecatalyst._body import Body
|
|
22
|
+
from capo_codecatalyst._iter import StaticAnyIterator
|
|
19
23
|
from capo_codecatalyst.errors import ServiceError
|
|
20
24
|
|
|
21
25
|
if TYPE_CHECKING:
|
|
@@ -138,6 +142,43 @@ def _is_retryable(exc: Exception) -> bool:
|
|
|
138
142
|
return False
|
|
139
143
|
|
|
140
144
|
|
|
145
|
+
def _is_pre_transmission(exc: Exception) -> bool:
|
|
146
|
+
# True when the request body was certainly not written before the error,
|
|
147
|
+
# so the same stream can be reused as-is. A bare ConnectionError is
|
|
148
|
+
# ambiguous ("cannot be established or is lost"), so it does not qualify.
|
|
149
|
+
return isinstance(exc, (ConnectTimeoutError, PoolTimeoutError))
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def _prepare_retry(inp: object) -> bool:
|
|
153
|
+
if not isinstance(inp, dict):
|
|
154
|
+
return True
|
|
155
|
+
for value in inp.values():
|
|
156
|
+
if isinstance(value, Body):
|
|
157
|
+
value = cast(Body[Iterator[bytes]], value)
|
|
158
|
+
if value.rebuild() is None:
|
|
159
|
+
return False
|
|
160
|
+
elif isinstance(value, StaticAnyIterator):
|
|
161
|
+
continue
|
|
162
|
+
elif isinstance(value, (Iterator, AsyncIterator)):
|
|
163
|
+
return False
|
|
164
|
+
return True
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
async def _aprepare_retry(inp: object) -> bool:
|
|
168
|
+
if not isinstance(inp, dict):
|
|
169
|
+
return True
|
|
170
|
+
for value in inp.values():
|
|
171
|
+
if isinstance(value, Body):
|
|
172
|
+
value = cast(Body[AsyncIterator[bytes]], value)
|
|
173
|
+
if await value.arebuild() is None:
|
|
174
|
+
return False
|
|
175
|
+
elif isinstance(value, StaticAnyIterator):
|
|
176
|
+
continue
|
|
177
|
+
elif isinstance(value, (Iterator, AsyncIterator)):
|
|
178
|
+
return False
|
|
179
|
+
return True
|
|
180
|
+
|
|
181
|
+
|
|
141
182
|
def _retry_delay(attempt: int, is_throttling: bool) -> float:
|
|
142
183
|
base = 1.0 if is_throttling else 0.5
|
|
143
184
|
delay = base * (2.0 ** min(attempt - 1, 10))
|
|
@@ -159,6 +200,10 @@ def retry() -> Interceptor[TInput, TOutput]:
|
|
|
159
200
|
raise
|
|
160
201
|
last_exc = exc
|
|
161
202
|
if attempt < max_attempts:
|
|
203
|
+
if not _is_pre_transmission(exc) and not _prepare_retry(
|
|
204
|
+
request.input
|
|
205
|
+
):
|
|
206
|
+
raise
|
|
162
207
|
is_throttling = (
|
|
163
208
|
isinstance(exc, ServiceError) and exc.is_throttling_error
|
|
164
209
|
)
|
|
@@ -184,6 +229,10 @@ def aretry() -> AsyncInterceptor[TInput, TOutput]:
|
|
|
184
229
|
raise
|
|
185
230
|
last_exc = exc
|
|
186
231
|
if attempt < max_attempts:
|
|
232
|
+
if not _is_pre_transmission(exc) and not await _aprepare_retry(
|
|
233
|
+
request.input
|
|
234
|
+
):
|
|
235
|
+
raise
|
|
187
236
|
is_throttling = (
|
|
188
237
|
isinstance(exc, ServiceError) and exc.is_throttling_error
|
|
189
238
|
)
|