harbor-framework-client 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.
- harbor_client/__init__.py +49 -0
- harbor_client/__init__.pyi +661 -0
- harbor_client/_openapi.json.gz +0 -0
- harbor_client/account/__init__.py +3 -0
- harbor_client/account/client.py +236 -0
- harbor_client/agents/__init__.py +3 -0
- harbor_client/agents/client.py +230 -0
- harbor_client/api_keys/__init__.py +3 -0
- harbor_client/api_keys/client.py +457 -0
- harbor_client/api_keys/types/__init__.py +13 -0
- harbor_client/api_keys/types/api_keys_list_bad_request_response.py +13 -0
- harbor_client/base_client.py +912 -0
- harbor_client/client.py +207 -0
- harbor_client/core/__init__.py +20 -0
- harbor_client/core/api_error.py +3 -0
- harbor_client/core/client_wrapper.py +73 -0
- harbor_client/core/file.py +57 -0
- harbor_client/core/http_response.py +5 -0
- harbor_client/core/httpx_session.py +136 -0
- harbor_client/core/jsonable_encoder.py +52 -0
- harbor_client/core/remove_none_from_dict.py +5 -0
- harbor_client/core/request_options.py +47 -0
- harbor_client/environment.py +4 -0
- harbor_client/errors.py +119 -0
- harbor_client/jobs/__init__.py +3 -0
- harbor_client/jobs/client.py +2994 -0
- harbor_client/jobs/types/__init__.py +97 -0
- harbor_client/jobs/types/jobs_get_filters_request_field.py +3 -0
- harbor_client/jobs/types/jobs_get_overview_request_force_combined.py +3 -0
- harbor_client/jobs/types/jobs_list_bad_request_response.py +13 -0
- harbor_client/jobs/types/jobs_list_request_sort.py +3 -0
- harbor_client/jobs/types/jobs_list_tasks_bad_request_response.py +13 -0
- harbor_client/jobs/types/jobs_list_tasks_request_sort_by.py +3 -0
- harbor_client/jobs/types/jobs_list_tasks_request_sort_order.py +3 -0
- harbor_client/jobs/types/jobs_submit_response.py +3 -0
- harbor_client/jobs/types/result_job_create_visibility.py +3 -0
- harbor_client/jobs/types/submit_job_request_config.py +3 -0
- harbor_client/jobs/types/submit_job_request_config_agent_setup_timeout_multiplier.py +3 -0
- harbor_client/jobs/types/submit_job_request_config_agent_setup_timeout_multiplier_one.py +3 -0
- harbor_client/jobs/types/submit_job_request_config_agent_timeout_multiplier.py +3 -0
- harbor_client/jobs/types/submit_job_request_config_agent_timeout_multiplier_one.py +3 -0
- harbor_client/jobs/types/submit_job_request_config_artifacts_item.py +3 -0
- harbor_client/jobs/types/submit_job_request_config_credential_mode.py +3 -0
- harbor_client/jobs/types/submit_job_request_config_environment_build_timeout_multiplier.py +3 -0
- harbor_client/jobs/types/submit_job_request_config_environment_build_timeout_multiplier_one.py +3 -0
- harbor_client/jobs/types/submit_job_request_config_timeout_multiplier.py +3 -0
- harbor_client/jobs/types/submit_job_request_config_timeout_multiplier_one.py +3 -0
- harbor_client/jobs/types/submit_job_request_config_verifier_timeout_multiplier.py +3 -0
- harbor_client/jobs/types/submit_job_request_config_verifier_timeout_multiplier_one.py +3 -0
- harbor_client/jobs/types/submit_job_request_regrade.py +3 -0
- harbor_client/jobs/types/submit_job_request_regrade_source_trial_id.py +3 -0
- harbor_client/jobs/types/update_job_sharing_request_visibility.py +3 -0
- harbor_client/leaderboards/__init__.py +3 -0
- harbor_client/leaderboards/client.py +1354 -0
- harbor_client/leaderboards/types/__init__.py +61 -0
- harbor_client/leaderboards/types/leaderboards_create_request_visibility.py +3 -0
- harbor_client/leaderboards/types/leaderboards_list_bad_request_response.py +13 -0
- harbor_client/leaderboards/types/leaderboards_list_rows_bad_request_response.py +13 -0
- harbor_client/leaderboards/types/leaderboards_list_trials_bad_request_response.py +13 -0
- harbor_client/leaderboards/types/leaderboards_update_request_definition.py +3 -0
- harbor_client/leaderboards/types/leaderboards_update_request_definition_visibility.py +3 -0
- harbor_client/leaderboards/types/leaderboards_update_request_row_deletes_item.py +3 -0
- harbor_client/leaderboards/types/leaderboards_update_request_row_updates_item.py +3 -0
- harbor_client/leaderboards/types/leaderboards_update_request_row_updates_item_status.py +3 -0
- harbor_client/leaderboards/types/leaderboards_update_request_trial_updates_item.py +3 -0
- harbor_client/leaderboards/types/leaderboards_update_request_trial_updates_item_operation.py +3 -0
- harbor_client/net/__init__.py +0 -0
- harbor_client/net/environment/__init__.py +4 -0
- harbor_client/net/environment/environment.py +32 -0
- harbor_client/net/headers/__init__.py +0 -0
- harbor_client/net/headers/access_token_auth.py +75 -0
- harbor_client/net/headers/base_header.py +34 -0
- harbor_client/net/request_chain/__init__.py +0 -0
- harbor_client/net/request_chain/handlers/__init__.py +0 -0
- harbor_client/net/request_chain/handlers/base_handler.py +51 -0
- harbor_client/net/request_chain/handlers/http_handler.py +607 -0
- harbor_client/net/request_chain/handlers/logging_handler.py +186 -0
- harbor_client/net/request_chain/handlers/retry_handler.py +295 -0
- harbor_client/net/request_chain/request_chain.py +76 -0
- harbor_client/net/sdk_config.py +101 -0
- harbor_client/net/transport/__init__.py +0 -0
- harbor_client/net/transport/api_error.py +118 -0
- harbor_client/net/transport/http_response.py +83 -0
- harbor_client/net/transport/pagination.py +156 -0
- harbor_client/net/transport/request.py +190 -0
- harbor_client/net/transport/request_error.py +34 -0
- harbor_client/net/transport/response.py +456 -0
- harbor_client/net/transport/serializer.py +490 -0
- harbor_client/net/transport/utils.py +41 -0
- harbor_client/organizations/__init__.py +3 -0
- harbor_client/organizations/client.py +346 -0
- harbor_client/packages/__init__.py +3 -0
- harbor_client/packages/client.py +2277 -0
- harbor_client/packages/types/__init__.py +53 -0
- harbor_client/packages/types/packages_list_version_catalog_bad_request_response.py +13 -0
- harbor_client/packages/types/packages_list_version_catalog_request_include_yanked.py +3 -0
- harbor_client/packages/types/packages_list_version_catalog_request_type.py +3 -0
- harbor_client/packages/types/packages_list_version_files_bad_request_response.py +13 -0
- harbor_client/packages/types/packages_list_versions_bad_request_response.py +13 -0
- harbor_client/packages/types/packages_list_versions_request_include_yanked.py +3 -0
- harbor_client/packages/types/packages_set_visibility_request_visibility.py +3 -0
- harbor_client/packages/types/packages_update_organization_access_request_action.py +3 -0
- harbor_client/py.typed +1 -0
- harbor_client/rollouts/__init__.py +3 -0
- harbor_client/rollouts/client.py +1364 -0
- harbor_client/rollouts/types/__init__.py +31 -0
- harbor_client/rollouts/types/rollouts_get_filters_request_attempts.py +3 -0
- harbor_client/rollouts/types/rollouts_get_filters_request_failed_only.py +3 -0
- harbor_client/rollouts/types/rollouts_get_filters_request_field.py +3 -0
- harbor_client/rollouts/types/rollouts_get_filters_request_terminal.py +3 -0
- harbor_client/rollouts/types/rollouts_list_bad_request_response.py +13 -0
- harbor_client/rollouts/types/rollouts_list_request_attempts.py +3 -0
- harbor_client/rollouts/types/rollouts_list_request_failed_only.py +3 -0
- harbor_client/rollouts/types/rollouts_list_request_sort.py +3 -0
- harbor_client/rollouts/types/rollouts_list_request_terminal.py +3 -0
- harbor_client/secrets/__init__.py +3 -0
- harbor_client/secrets/client.py +1309 -0
- harbor_client/secrets/types/__init__.py +61 -0
- harbor_client/secrets/types/registry_credential_upsert_encoded_provider.py +3 -0
- harbor_client/secrets/types/secrets_list_bad_request_response.py +13 -0
- harbor_client/secrets/types/secrets_list_registry_credentials_request_status.py +3 -0
- harbor_client/secrets/types/secrets_list_registry_credentials_response.py +3 -0
- harbor_client/secrets/types/secrets_list_request_status_filter.py +3 -0
- harbor_client/secrets/types/secrets_preflight_request_config.py +3 -0
- harbor_client/secrets/types/secrets_preflight_request_config_credential_mode.py +3 -0
- harbor_client/secrets/types/secrets_revoke_registry_credential_request_purge.py +3 -0
- harbor_client/secrets/types/secrets_revoke_request_scope.py +3 -0
- harbor_client/secrets/types/secrets_revoke_response.py +3 -0
- harbor_client/secrets/types/secrets_upsert_conflict_response.py +13 -0
- harbor_client/secrets/types/secrets_upsert_registry_credential_conflict_response.py +11 -0
- harbor_client/secrets/types/secrets_upsert_request_scope.py +3 -0
- harbor_client/services/__init__.py +0 -0
- harbor_client/services/async_/__init__.py +0 -0
- harbor_client/services/async_/utils/__init__.py +0 -0
- harbor_client/services/async_/utils/to_async.py +20 -0
- harbor_client/services/utils/__init__.py +0 -0
- harbor_client/services/utils/base_service.py +408 -0
- harbor_client/services/utils/default_headers.py +69 -0
- harbor_client/services/utils/validator.py +474 -0
- harbor_client/storage/__init__.py +3 -0
- harbor_client/storage/client.py +269 -0
- harbor_client/transfers.py +724 -0
- harbor_client/trials/__init__.py +3 -0
- harbor_client/trials/client.py +1939 -0
- harbor_client/trials/types/__init__.py +29 -0
- harbor_client/trials/types/trials_get_filters_request_attempts.py +3 -0
- harbor_client/trials/types/trials_get_filters_request_failed_only.py +3 -0
- harbor_client/trials/types/trials_get_filters_request_field.py +3 -0
- harbor_client/trials/types/trials_get_filters_request_terminal.py +3 -0
- harbor_client/trials/types/trials_list_bad_request_response.py +13 -0
- harbor_client/trials/types/trials_list_request_attempts.py +3 -0
- harbor_client/trials/types/trials_list_request_failed_only.py +3 -0
- harbor_client/trials/types/trials_list_request_sort.py +3 -0
- harbor_client/trials/types/trials_list_request_terminal.py +3 -0
- harbor_client/types/__init__.py +1006 -0
- harbor_client/types/__init__.pyi +644 -0
- harbor_client/types/account_identity.py +15 -0
- harbor_client/types/agent_identity.py +19 -0
- harbor_client/types/agent_options.py +1 -0
- harbor_client/types/agent_source.py +40 -0
- harbor_client/types/agent_source_manifest.py +57 -0
- harbor_client/types/agent_source_runtime.py +33 -0
- harbor_client/types/agents_response.py +16 -0
- harbor_client/types/api_key_create.py +19 -0
- harbor_client/types/api_key_created.py +44 -0
- harbor_client/types/api_key_metadata.py +41 -0
- harbor_client/types/api_key_metadata_page.py +24 -0
- harbor_client/types/api_keys_list_bad_request_response.py +35 -0
- harbor_client/types/artifact_config.py +26 -0
- harbor_client/types/available_dataset_task_dependency.py +97 -0
- harbor_client/types/bad_request_encoded.py +79 -0
- harbor_client/types/bad_request_error_body.py +35 -0
- harbor_client/types/cancel_job_request.py +15 -0
- harbor_client/types/cancel_trial_request.py +15 -0
- harbor_client/types/conflict_encoded.py +77 -0
- harbor_client/types/conflict_error_body.py +38 -0
- harbor_client/types/create_leaderboard_response.py +22 -0
- harbor_client/types/create_leaderboard_row_input.py +32 -0
- harbor_client/types/created_result_job.py +49 -0
- harbor_client/types/created_result_trial.py +28 -0
- harbor_client/types/credential_proxy_header_transform.py +16 -0
- harbor_client/types/credential_proxy_path_match.py +15 -0
- harbor_client/types/credential_proxy_policy_rule.py +21 -0
- harbor_client/types/credential_proxy_request_match.py +20 -0
- harbor_client/types/dataset_publish_task_reference.py +21 -0
- harbor_client/types/dataset_version_detail.py +95 -0
- harbor_client/types/dataset_version_file.py +50 -0
- harbor_client/types/dataset_version_manifest.py +91 -0
- harbor_client/types/dataset_version_revision_summary.py +22 -0
- harbor_client/types/delete_jobs_request.py +17 -0
- harbor_client/types/delete_jobs_response.py +22 -0
- harbor_client/types/dry_run_response.py +15 -0
- harbor_client/types/ensure_organization_response.py +18 -0
- harbor_client/types/evaluation_comparison.py +27 -0
- harbor_client/types/evaluation_comparison_agent_model.py +34 -0
- harbor_client/types/evaluation_comparison_cell.py +109 -0
- harbor_client/types/evaluation_comparison_task.py +22 -0
- harbor_client/types/evaluation_job_reference.py +48 -0
- harbor_client/types/evaluation_metric_set.py +42 -0
- harbor_client/types/evaluation_summary.py +21 -0
- harbor_client/types/evaluation_summary_row.py +128 -0
- harbor_client/types/existing_registry_credential.py +28 -0
- harbor_client/types/existing_secret_summary.py +31 -0
- harbor_client/types/filter_values_response.py +72 -0
- harbor_client/types/forbidden_encoded.py +79 -0
- harbor_client/types/hosted_agent_config.py +72 -0
- harbor_client/types/hosted_dataset_config.py +62 -0
- harbor_client/types/hosted_diff_selectors.py +22 -0
- harbor_client/types/hosted_github_agent_source.py +30 -0
- harbor_client/types/hosted_job_trial_regrade_source.py +19 -0
- harbor_client/types/hosted_local_task_requirements.py +20 -0
- harbor_client/types/hosted_preflight_environment_config.py +24 -0
- harbor_client/types/hosted_retry_config.py +32 -0
- harbor_client/types/hosted_secret_selection.py +21 -0
- harbor_client/types/hosted_submission_credential_proxy_path_match.py +17 -0
- harbor_client/types/hosted_submission_credential_proxy_policy_rule.py +23 -0
- harbor_client/types/hosted_submission_credential_proxy_request_match.py +22 -0
- harbor_client/types/hosted_submission_dataset_config.py +64 -0
- harbor_client/types/hosted_submission_environment_config.py +26 -0
- harbor_client/types/hosted_submission_retry_config.py +32 -0
- harbor_client/types/hosted_submission_task_config.py +45 -0
- harbor_client/types/hosted_task_config.py +45 -0
- harbor_client/types/hosted_task_environment_requirement.py +26 -0
- harbor_client/types/hosted_verifier_config.py +75 -0
- harbor_client/types/internal_server_error_encoded.py +93 -0
- harbor_client/types/invalid_page_size_encoded.py +58 -0
- harbor_client/types/invalid_page_token_encoded.py +60 -0
- harbor_client/types/job_artifact_type.py +5 -0
- harbor_client/types/job_bucket_circuit_state.py +93 -0
- harbor_client/types/job_cancellation_summary.py +47 -0
- harbor_client/types/job_circuit_state.py +90 -0
- harbor_client/types/job_creator.py +28 -0
- harbor_client/types/job_detail.py +84 -0
- harbor_client/types/job_manual_pause_summary.py +66 -0
- harbor_client/types/job_overview.py +332 -0
- harbor_client/types/job_overview_statistics.py +97 -0
- harbor_client/types/job_owner_organization.py +28 -0
- harbor_client/types/job_package_run_target.py +21 -0
- harbor_client/types/job_page.py +24 -0
- harbor_client/types/job_path_run_target.py +24 -0
- harbor_client/types/job_response.py +17 -0
- harbor_client/types/job_reward_metric_set.py +42 -0
- harbor_client/types/job_share_organization_summary.py +22 -0
- harbor_client/types/job_sharing.py +38 -0
- harbor_client/types/job_summary.py +73 -0
- harbor_client/types/job_task_page.py +24 -0
- harbor_client/types/job_task_summary.py +146 -0
- harbor_client/types/job_trial_status.py +4 -0
- harbor_client/types/job_trial_status_item.py +128 -0
- harbor_client/types/jobs_copy_request.py +22 -0
- harbor_client/types/jobs_get_filters_request_field.py +17 -0
- harbor_client/types/jobs_get_overview_request_force_combined.py +7 -0
- harbor_client/types/jobs_list_bad_request_response.py +35 -0
- harbor_client/types/jobs_list_request_sort.py +21 -0
- harbor_client/types/jobs_list_tasks_bad_request_response.py +35 -0
- harbor_client/types/jobs_list_tasks_request_sort_by.py +25 -0
- harbor_client/types/jobs_list_tasks_request_sort_order.py +5 -0
- harbor_client/types/jobs_rename_request.py +15 -0
- harbor_client/types/jobs_submit_response.py +15 -0
- harbor_client/types/jobs_transfer_request.py +22 -0
- harbor_client/types/leaderboard_change_summary.py +37 -0
- harbor_client/types/leaderboard_definition.py +67 -0
- harbor_client/types/leaderboard_detail.py +17 -0
- harbor_client/types/leaderboard_mutation_record.py +64 -0
- harbor_client/types/leaderboard_mutation_row.py +43 -0
- harbor_client/types/leaderboard_package_selector_encoded.py +16 -0
- harbor_client/types/leaderboard_ranked_row.py +44 -0
- harbor_client/types/leaderboard_read_column_definition.py +55 -0
- harbor_client/types/leaderboard_read_ranking_rule.py +30 -0
- harbor_client/types/leaderboard_row_detail.py +17 -0
- harbor_client/types/leaderboard_rows_page.py +28 -0
- harbor_client/types/leaderboard_summary.py +64 -0
- harbor_client/types/leaderboard_summary_page.py +24 -0
- harbor_client/types/leaderboard_trial_link.py +18 -0
- harbor_client/types/leaderboard_trial_link_page.py +23 -0
- harbor_client/types/leaderboard_write_column_definition.py +55 -0
- harbor_client/types/leaderboard_write_ranking_rule.py +30 -0
- harbor_client/types/leaderboards_create_request.py +59 -0
- harbor_client/types/leaderboards_list_bad_request_response.py +37 -0
- harbor_client/types/leaderboards_list_rows_bad_request_response.py +37 -0
- harbor_client/types/leaderboards_list_trials_bad_request_response.py +39 -0
- harbor_client/types/leaderboards_update_request.py +152 -0
- harbor_client/types/mean_aggregate.py +19 -0
- harbor_client/types/metric_config.py +20 -0
- harbor_client/types/model_identity.py +22 -0
- harbor_client/types/my_organizations.py +4 -0
- harbor_client/types/my_organizations_item.py +36 -0
- harbor_client/types/not_found_encoded.py +77 -0
- harbor_client/types/organization_detail.py +38 -0
- harbor_client/types/organizations_ensure_request.py +15 -0
- harbor_client/types/owner_organization.py +31 -0
- harbor_client/types/package_access.py +46 -0
- harbor_client/types/package_access_grant_creator.py +22 -0
- harbor_client/types/package_access_organization_summary.py +30 -0
- harbor_client/types/package_name_reference.py +18 -0
- harbor_client/types/package_organization_grant.py +44 -0
- harbor_client/types/package_public_grant.py +40 -0
- harbor_client/types/package_tag.py +24 -0
- harbor_client/types/package_tags.py +4 -0
- harbor_client/types/package_version_catalog_page.py +21 -0
- harbor_client/types/package_version_detail.py +27 -0
- harbor_client/types/package_version_file_page.py +21 -0
- harbor_client/types/package_version_manifest.py +27 -0
- harbor_client/types/package_version_summary.py +69 -0
- harbor_client/types/packages_list_version_catalog_bad_request_response.py +41 -0
- harbor_client/types/packages_list_version_catalog_request_include_yanked.py +7 -0
- harbor_client/types/packages_list_version_catalog_request_type.py +7 -0
- harbor_client/types/packages_list_version_files_bad_request_response.py +41 -0
- harbor_client/types/packages_list_versions_bad_request_response.py +37 -0
- harbor_client/types/packages_list_versions_request_include_yanked.py +7 -0
- harbor_client/types/packages_set_visibility_request.py +27 -0
- harbor_client/types/packages_update_organization_access_request.py +26 -0
- harbor_client/types/registry_credential.py +44 -0
- harbor_client/types/registry_credential_replacement_required_encoded.py +86 -0
- harbor_client/types/registry_credential_replacement_stale_encoded.py +79 -0
- harbor_client/types/registry_credential_revoke_result.py +21 -0
- harbor_client/types/registry_credential_summary.py +46 -0
- harbor_client/types/registry_credential_upsert_encoded.py +48 -0
- harbor_client/types/registry_package.py +37 -0
- harbor_client/types/registry_package_version.py +44 -0
- harbor_client/types/registry_package_version_page.py +25 -0
- harbor_client/types/registry_version_file.py +47 -0
- harbor_client/types/rename_job_response.py +21 -0
- harbor_client/types/reserve_temporary_package_request.py +25 -0
- harbor_client/types/reserve_temporary_task_response.py +27 -0
- harbor_client/types/resolved_task_step.py +38 -0
- harbor_client/types/result_job_create.py +40 -0
- harbor_client/types/result_model_usage.py +31 -0
- harbor_client/types/result_trial_create.py +92 -0
- harbor_client/types/retry_rollout_response.py +15 -0
- harbor_client/types/retry_trial_response.py +15 -0
- harbor_client/types/reward_value.py +3 -0
- harbor_client/types/rollout_response.py +17 -0
- harbor_client/types/rollouts_get_filters_request_attempts.py +7 -0
- harbor_client/types/rollouts_get_filters_request_failed_only.py +7 -0
- harbor_client/types/rollouts_get_filters_request_field.py +18 -0
- harbor_client/types/rollouts_get_filters_request_terminal.py +7 -0
- harbor_client/types/rollouts_list_bad_request_response.py +34 -0
- harbor_client/types/rollouts_list_request_attempts.py +5 -0
- harbor_client/types/rollouts_list_request_failed_only.py +7 -0
- harbor_client/types/rollouts_list_request_sort.py +47 -0
- harbor_client/types/rollouts_list_request_terminal.py +5 -0
- harbor_client/types/run_state.py +10 -0
- harbor_client/types/secret_metadata.py +54 -0
- harbor_client/types/secret_metadata_page.py +21 -0
- harbor_client/types/secret_preflight.py +152 -0
- harbor_client/types/secret_replacement_required_encoded.py +72 -0
- harbor_client/types/secret_replacement_stale_encoded.py +67 -0
- harbor_client/types/secret_write_result.py +51 -0
- harbor_client/types/secrets_list_bad_request_response.py +35 -0
- harbor_client/types/secrets_list_registry_credentials_request_status.py +7 -0
- harbor_client/types/secrets_list_registry_credentials_response.py +18 -0
- harbor_client/types/secrets_list_request_status_filter.py +7 -0
- harbor_client/types/secrets_preflight_request.py +76 -0
- harbor_client/types/secrets_revoke_registry_credential_request_purge.py +7 -0
- harbor_client/types/secrets_revoke_request.py +33 -0
- harbor_client/types/secrets_revoke_response.py +34 -0
- harbor_client/types/secrets_upsert_conflict_response.py +39 -0
- harbor_client/types/secrets_upsert_registry_credential_conflict_response.py +40 -0
- harbor_client/types/secrets_upsert_request.py +43 -0
- harbor_client/types/selected_secret.py +48 -0
- harbor_client/types/service_unavailable_encoded.py +85 -0
- harbor_client/types/set_package_visibility_response.py +50 -0
- harbor_client/types/storage_copy_result.py +60 -0
- harbor_client/types/storage_dataset_upload_create.py +50 -0
- harbor_client/types/storage_dataset_upload_metadata.py +49 -0
- harbor_client/types/storage_dataset_upload_result.py +50 -0
- harbor_client/types/storage_download.py +64 -0
- harbor_client/types/storage_http_transfer.py +33 -0
- harbor_client/types/storage_job_upload_create.py +39 -0
- harbor_client/types/storage_job_upload_metadata.py +45 -0
- harbor_client/types/storage_publication_file.py +25 -0
- harbor_client/types/storage_result_upload_result.py +15 -0
- harbor_client/types/storage_task_upload_create.py +50 -0
- harbor_client/types/storage_task_upload_metadata.py +79 -0
- harbor_client/types/storage_task_upload_result.py +39 -0
- harbor_client/types/storage_trial_upload_create.py +41 -0
- harbor_client/types/storage_tus_transfer.py +56 -0
- harbor_client/types/storage_upload_create.py +44 -0
- harbor_client/types/storage_upload_file.py +63 -0
- harbor_client/types/storage_upload_file_input.py +32 -0
- harbor_client/types/storage_upload_receipt.py +53 -0
- harbor_client/types/storage_upload_session.py +61 -0
- harbor_client/types/submit_job_request.py +277 -0
- harbor_client/types/submit_job_response.py +51 -0
- harbor_client/types/sum_aggregate.py +19 -0
- harbor_client/types/tag_package_version_request.py +15 -0
- harbor_client/types/tag_package_version_response.py +18 -0
- harbor_client/types/task_environment_requirement.py +26 -0
- harbor_client/types/task_identity.py +22 -0
- harbor_client/types/task_publish_step.py +47 -0
- harbor_client/types/task_version_detail.py +115 -0
- harbor_client/types/task_version_manifest.py +119 -0
- harbor_client/types/too_many_requests_encoded.py +81 -0
- harbor_client/types/transfer_job_response.py +36 -0
- harbor_client/types/trial_artifact_type.py +5 -0
- harbor_client/types/trial_counts.py +33 -0
- harbor_client/types/trial_detail.py +103 -0
- harbor_client/types/trial_filter_values_response.py +76 -0
- harbor_client/types/trial_page.py +24 -0
- harbor_client/types/trial_response.py +17 -0
- harbor_client/types/trial_summary.py +83 -0
- harbor_client/types/trials_copy_request.py +22 -0
- harbor_client/types/trials_get_filters_request_attempts.py +7 -0
- harbor_client/types/trials_get_filters_request_failed_only.py +7 -0
- harbor_client/types/trials_get_filters_request_field.py +18 -0
- harbor_client/types/trials_get_filters_request_terminal.py +7 -0
- harbor_client/types/trials_list_bad_request_response.py +35 -0
- harbor_client/types/trials_list_request_attempts.py +5 -0
- harbor_client/types/trials_list_request_failed_only.py +5 -0
- harbor_client/types/trials_list_request_sort.py +47 -0
- harbor_client/types/trials_list_request_terminal.py +5 -0
- harbor_client/types/unauthorized_encoded.py +79 -0
- harbor_client/types/unavailable_dataset_task_dependency.py +43 -0
- harbor_client/types/update_job_sharing_request.py +36 -0
- harbor_client/types/update_leaderboard_response.py +29 -0
- harbor_client/types/update_package_access_response.py +65 -0
- harbor_client/types/usage.py +25 -0
- harbor_client/types/usage_aggregates.py +26 -0
- harbor_client/types/utils/__init__.py +0 -0
- harbor_client/types/utils/base_error.py +127 -0
- harbor_client/types/utils/base_model.py +439 -0
- harbor_client/types/utils/cast_models.py +226 -0
- harbor_client/types/utils/json_map.py +84 -0
- harbor_client/types/utils/one_of_base_model.py +173 -0
- harbor_client/types/utils/sentinel.py +19 -0
- harbor_client/validation.py +335 -0
- harbor_client/version.py +9 -0
- harbor_framework_client-0.1.0.dist-info/METADATA +134 -0
- harbor_framework_client-0.1.0.dist-info/RECORD +433 -0
- harbor_framework_client-0.1.0.dist-info/WHEEL +5 -0
- harbor_framework_client-0.1.0.dist-info/licenses/LICENSE +201 -0
- harbor_framework_client-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
from typing import Any, Optional, Generator, List, Union
|
|
2
|
+
from ..services.utils.validator import Validator
|
|
3
|
+
from ..services.utils.base_service import BaseService
|
|
4
|
+
from ..types.utils.sentinel import SENTINEL
|
|
5
|
+
from ..types.utils.cast_models import cast_models
|
|
6
|
+
from ..types.utils.base_model import construct_lenient
|
|
7
|
+
from ..types.api_keys_list_bad_request_response import (
|
|
8
|
+
ApiKeysListBadRequestResponse_adapter,
|
|
9
|
+
)
|
|
10
|
+
from ..types import (
|
|
11
|
+
ApiKeyCreate,
|
|
12
|
+
ApiKeyCreated,
|
|
13
|
+
ApiKeyMetadata,
|
|
14
|
+
ApiKeyMetadataPage,
|
|
15
|
+
ApiKeysListBadRequestResponse,
|
|
16
|
+
BadRequestEncoded,
|
|
17
|
+
ConflictEncoded,
|
|
18
|
+
ForbiddenEncoded,
|
|
19
|
+
InternalServerErrorEncoded,
|
|
20
|
+
NotFoundEncoded,
|
|
21
|
+
UnauthorizedEncoded,
|
|
22
|
+
)
|
|
23
|
+
from ..net.transport.serializer import Serializer
|
|
24
|
+
from ..net.transport.pagination import SyncPager
|
|
25
|
+
from ..net.transport.http_response import HttpResponse
|
|
26
|
+
from ..net.sdk_config import should_validate_response
|
|
27
|
+
from ..net.sdk_config import SdkConfig
|
|
28
|
+
from ..net.environment.environment import HarborApiClientEnvironment
|
|
29
|
+
from ..core.request_options import RequestOptions
|
|
30
|
+
from ..services.async_.utils.to_async import to_async
|
|
31
|
+
from typing import Awaitable
|
|
32
|
+
from ..net.transport.pagination import AsyncPager
|
|
33
|
+
import asyncio
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class ApiKeysClient(BaseService):
|
|
37
|
+
"""
|
|
38
|
+
Fern-style resource client for ApiKeysClient.
|
|
39
|
+
Exposes this resource's endpoints and, when the resource has sub-resources, lazy
|
|
40
|
+
accessors to its child clients (`client.<parent>.<child>.method(...)`).
|
|
41
|
+
Inherits authentication, base-url and request handling from BaseService.
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
def __init__(self, *args, **kwargs):
|
|
45
|
+
"""Initialize the resource client, its child clients and method-level configs."""
|
|
46
|
+
super().__init__(*args, **kwargs)
|
|
47
|
+
self._raw_client = self.with_raw_response
|
|
48
|
+
self._list_config: SdkConfig = {}
|
|
49
|
+
self._create_config: SdkConfig = {}
|
|
50
|
+
self._revoke_config: SdkConfig = {}
|
|
51
|
+
|
|
52
|
+
def set_list_config(self, config: SdkConfig):
|
|
53
|
+
"""
|
|
54
|
+
Sets method-level configuration for list.
|
|
55
|
+
|
|
56
|
+
:param SdkConfig config: Configuration dictionary to override service-level defaults.
|
|
57
|
+
:return: The service instance for method chaining.
|
|
58
|
+
"""
|
|
59
|
+
self._list_config = config
|
|
60
|
+
return self
|
|
61
|
+
|
|
62
|
+
def set_create_config(self, config: SdkConfig):
|
|
63
|
+
"""
|
|
64
|
+
Sets method-level configuration for create.
|
|
65
|
+
|
|
66
|
+
:param SdkConfig config: Configuration dictionary to override service-level defaults.
|
|
67
|
+
:return: The service instance for method chaining.
|
|
68
|
+
"""
|
|
69
|
+
self._create_config = config
|
|
70
|
+
return self
|
|
71
|
+
|
|
72
|
+
def set_revoke_config(self, config: SdkConfig):
|
|
73
|
+
"""
|
|
74
|
+
Sets method-level configuration for revoke.
|
|
75
|
+
|
|
76
|
+
:param SdkConfig config: Configuration dictionary to override service-level defaults.
|
|
77
|
+
:return: The service instance for method chaining.
|
|
78
|
+
"""
|
|
79
|
+
self._revoke_config = config
|
|
80
|
+
return self
|
|
81
|
+
|
|
82
|
+
@property
|
|
83
|
+
def with_raw_response(self) -> "RawApiKeysClient":
|
|
84
|
+
"""
|
|
85
|
+
Returns a raw-response client whose methods mirror this resource but return
|
|
86
|
+
``HttpResponse[T]`` (parsed body plus the raw status code and headers) instead of
|
|
87
|
+
the bare deserialized body.
|
|
88
|
+
"""
|
|
89
|
+
return RawApiKeysClient(self)
|
|
90
|
+
|
|
91
|
+
@cast_models
|
|
92
|
+
def list(
|
|
93
|
+
self,
|
|
94
|
+
*,
|
|
95
|
+
page_size: str = SENTINEL,
|
|
96
|
+
page_token: str = SENTINEL,
|
|
97
|
+
request_options: Optional[RequestOptions] = None,
|
|
98
|
+
) -> SyncPager[ApiKeyMetadata]:
|
|
99
|
+
"""list
|
|
100
|
+
|
|
101
|
+
:param page_size: page_size, defaults to None
|
|
102
|
+
:type page_size: str, optional
|
|
103
|
+
:param page_token: page_token, defaults to None
|
|
104
|
+
:type page_token: str, optional
|
|
105
|
+
...
|
|
106
|
+
:raises RequestError: Raised when a request fails, with optional HTTP status code and details.
|
|
107
|
+
...
|
|
108
|
+
:return: The parsed response data.
|
|
109
|
+
:rtype: SyncPager[ApiKeyMetadata]
|
|
110
|
+
"""
|
|
111
|
+
self = self._for_one_call()
|
|
112
|
+
|
|
113
|
+
Validator(str).is_optional().validate(page_size, "page_size")
|
|
114
|
+
Validator(str).is_optional().validate(page_token, "page_token")
|
|
115
|
+
|
|
116
|
+
resolved_config = self._get_resolved_config(self._list_config, request_options)
|
|
117
|
+
|
|
118
|
+
def _paginate() -> Generator[List[ApiKeyMetadata], None, None]:
|
|
119
|
+
nonlocal page_token
|
|
120
|
+
while True:
|
|
121
|
+
serialized_request = (
|
|
122
|
+
Serializer(
|
|
123
|
+
f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/api-keys",
|
|
124
|
+
[self.get_access_token(resolved_config)],
|
|
125
|
+
resolved_config,
|
|
126
|
+
)
|
|
127
|
+
.add_header(
|
|
128
|
+
"Harbor-API-Version",
|
|
129
|
+
self._global_headers.get("Harbor-API-Version"),
|
|
130
|
+
)
|
|
131
|
+
.add_query("page_size", page_size)
|
|
132
|
+
.add_query("page_token", page_token)
|
|
133
|
+
.add_error(401, UnauthorizedEncoded)
|
|
134
|
+
.add_error(403, ForbiddenEncoded)
|
|
135
|
+
.add_error(404, NotFoundEncoded)
|
|
136
|
+
.add_error(500, InternalServerErrorEncoded)
|
|
137
|
+
.serialize()
|
|
138
|
+
.set_method("GET")
|
|
139
|
+
)
|
|
140
|
+
response, status, content = self.send_request(serialized_request)
|
|
141
|
+
parsed_response = (
|
|
142
|
+
ApiKeyMetadataPage.model_validate(response)
|
|
143
|
+
if should_validate_response(resolved_config)
|
|
144
|
+
else construct_lenient(ApiKeyMetadataPage, response)
|
|
145
|
+
)
|
|
146
|
+
current_page = parsed_response.api_keys
|
|
147
|
+
|
|
148
|
+
yield current_page
|
|
149
|
+
|
|
150
|
+
next_cursor = parsed_response.next_page_token
|
|
151
|
+
if not next_cursor:
|
|
152
|
+
break
|
|
153
|
+
|
|
154
|
+
page_token = next_cursor
|
|
155
|
+
|
|
156
|
+
return SyncPager(_paginate(), lambda: self._last_response)
|
|
157
|
+
|
|
158
|
+
@cast_models
|
|
159
|
+
def create(
|
|
160
|
+
self,
|
|
161
|
+
*,
|
|
162
|
+
name: str,
|
|
163
|
+
expires_at: Union[str, None] = SENTINEL,
|
|
164
|
+
request_options: Optional[RequestOptions] = None,
|
|
165
|
+
) -> ApiKeyCreated:
|
|
166
|
+
"""Create a personal API key using a signed-in user session. Harbor API keys and exchanged API-key JWTs cannot create keys. The raw key is returned once. Do not retry an ambiguous creation response.
|
|
167
|
+
|
|
168
|
+
:param request_body: The request body.
|
|
169
|
+
:type request_body: ApiKeyCreate
|
|
170
|
+
...
|
|
171
|
+
:raises RequestError: Raised when a request fails, with optional HTTP status code and details.
|
|
172
|
+
...
|
|
173
|
+
:return: The parsed response data.
|
|
174
|
+
:rtype: ApiKeyCreated
|
|
175
|
+
"""
|
|
176
|
+
|
|
177
|
+
resolved_config = self._get_resolved_config(
|
|
178
|
+
self._create_config, request_options
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
request_body = ApiKeyCreate(
|
|
182
|
+
name=name,
|
|
183
|
+
**dict[str, Any](
|
|
184
|
+
{
|
|
185
|
+
k: v
|
|
186
|
+
for k, v in {"expires_at": expires_at}.items()
|
|
187
|
+
if v is not SENTINEL
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
)
|
|
191
|
+
Validator(ApiKeyCreate).validate(request_body, "request_body")
|
|
192
|
+
serialized_request = (
|
|
193
|
+
Serializer(
|
|
194
|
+
f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/api-keys",
|
|
195
|
+
[self.get_access_token(resolved_config)],
|
|
196
|
+
resolved_config,
|
|
197
|
+
)
|
|
198
|
+
.add_header(
|
|
199
|
+
"Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
|
|
200
|
+
)
|
|
201
|
+
.add_error(401, UnauthorizedEncoded)
|
|
202
|
+
.add_error(500, InternalServerErrorEncoded)
|
|
203
|
+
.serialize()
|
|
204
|
+
.set_method("POST")
|
|
205
|
+
.set_body(request_body)
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
response, status, content = self.send_request(serialized_request)
|
|
209
|
+
return (
|
|
210
|
+
None
|
|
211
|
+
if response in (b"", "")
|
|
212
|
+
else (
|
|
213
|
+
ApiKeyCreated.model_validate(response)
|
|
214
|
+
if should_validate_response(resolved_config)
|
|
215
|
+
else construct_lenient(ApiKeyCreated, response)
|
|
216
|
+
)
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
@cast_models
|
|
220
|
+
def revoke(
|
|
221
|
+
self, key_id: str, *, request_options: Optional[RequestOptions] = None
|
|
222
|
+
) -> bool:
|
|
223
|
+
"""revoke
|
|
224
|
+
|
|
225
|
+
:param key_id: key_id
|
|
226
|
+
:type key_id: str
|
|
227
|
+
...
|
|
228
|
+
:raises RequestError: Raised when a request fails, with optional HTTP status code and details.
|
|
229
|
+
...
|
|
230
|
+
:return: The parsed response data.
|
|
231
|
+
:rtype: bool
|
|
232
|
+
"""
|
|
233
|
+
|
|
234
|
+
Validator(str).validate(key_id, "key_id")
|
|
235
|
+
|
|
236
|
+
resolved_config = self._get_resolved_config(
|
|
237
|
+
self._revoke_config, request_options
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
serialized_request = (
|
|
241
|
+
Serializer(
|
|
242
|
+
f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/api-keys/{{key_id}}/revoke",
|
|
243
|
+
[self.get_access_token(resolved_config)],
|
|
244
|
+
resolved_config,
|
|
245
|
+
)
|
|
246
|
+
.add_header(
|
|
247
|
+
"Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
|
|
248
|
+
)
|
|
249
|
+
.add_path("key_id", key_id)
|
|
250
|
+
.add_error(401, UnauthorizedEncoded)
|
|
251
|
+
.add_error(403, ForbiddenEncoded)
|
|
252
|
+
.add_error(404, NotFoundEncoded)
|
|
253
|
+
.add_error(500, InternalServerErrorEncoded)
|
|
254
|
+
.serialize()
|
|
255
|
+
.set_method("POST")
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
response, status, content = self.send_request(serialized_request)
|
|
259
|
+
return response
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
class RawApiKeysClient:
|
|
263
|
+
"""
|
|
264
|
+
Raw-response client for ApiKeysClient.
|
|
265
|
+
|
|
266
|
+
Each method delegates to the matching :class:`ApiKeysClient` method and wraps the result in
|
|
267
|
+
an ``HttpResponse[T]`` so callers can read ``.data`` alongside ``.status_code`` and
|
|
268
|
+
``.headers``.
|
|
269
|
+
"""
|
|
270
|
+
|
|
271
|
+
def __init__(self, client: ApiKeysClient):
|
|
272
|
+
self._client = client
|
|
273
|
+
self._client_wrapper = client._client_wrapper
|
|
274
|
+
|
|
275
|
+
def list(
|
|
276
|
+
self,
|
|
277
|
+
*,
|
|
278
|
+
page_size: str = SENTINEL,
|
|
279
|
+
page_token: str = SENTINEL,
|
|
280
|
+
request_options: Optional[RequestOptions] = None,
|
|
281
|
+
) -> HttpResponse[SyncPager[ApiKeyMetadata]]:
|
|
282
|
+
data = ApiKeysClient.list(
|
|
283
|
+
self._client,
|
|
284
|
+
**dict[str, Any](
|
|
285
|
+
{
|
|
286
|
+
k: v
|
|
287
|
+
for k, v in {
|
|
288
|
+
"page_size": page_size,
|
|
289
|
+
"page_token": page_token,
|
|
290
|
+
}.items()
|
|
291
|
+
if v is not SENTINEL
|
|
292
|
+
}
|
|
293
|
+
),
|
|
294
|
+
request_options=request_options,
|
|
295
|
+
)
|
|
296
|
+
return HttpResponse(data=data, response_source=lambda: data.last_response)
|
|
297
|
+
|
|
298
|
+
def create(
|
|
299
|
+
self,
|
|
300
|
+
*,
|
|
301
|
+
name: str,
|
|
302
|
+
expires_at: Union[str, None] = SENTINEL,
|
|
303
|
+
request_options: Optional[RequestOptions] = None,
|
|
304
|
+
) -> HttpResponse[ApiKeyCreated]:
|
|
305
|
+
data = ApiKeysClient.create(
|
|
306
|
+
self._client,
|
|
307
|
+
name=name,
|
|
308
|
+
**dict[str, Any](
|
|
309
|
+
{
|
|
310
|
+
k: v
|
|
311
|
+
for k, v in {"expires_at": expires_at}.items()
|
|
312
|
+
if v is not SENTINEL
|
|
313
|
+
}
|
|
314
|
+
),
|
|
315
|
+
request_options=request_options,
|
|
316
|
+
)
|
|
317
|
+
return HttpResponse(data=data, response=self._client._last_response)
|
|
318
|
+
|
|
319
|
+
def revoke(
|
|
320
|
+
self, key_id: str, *, request_options: Optional[RequestOptions] = None
|
|
321
|
+
) -> HttpResponse[bool]:
|
|
322
|
+
data = ApiKeysClient.revoke(
|
|
323
|
+
self._client, key_id, request_options=request_options
|
|
324
|
+
)
|
|
325
|
+
return HttpResponse(data=data, response=self._client._last_response)
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
class AsyncApiKeysClient(ApiKeysClient):
|
|
329
|
+
"""
|
|
330
|
+
Async wrapper for ApiKeysClient. Mirrors the sync client's endpoints (awaitable) and, for a
|
|
331
|
+
resource with sub-resources, its lazy child accessors (returning the async child clients).
|
|
332
|
+
"""
|
|
333
|
+
|
|
334
|
+
@property
|
|
335
|
+
def with_raw_response(self) -> "AsyncRawApiKeysClient": # type: ignore[override]
|
|
336
|
+
"""
|
|
337
|
+
Returns an async raw-response client whose methods mirror this resource but return
|
|
338
|
+
``HttpResponse[T]`` (parsed body plus the raw status code and headers).
|
|
339
|
+
"""
|
|
340
|
+
return AsyncRawApiKeysClient(self)
|
|
341
|
+
|
|
342
|
+
def list(
|
|
343
|
+
self,
|
|
344
|
+
*,
|
|
345
|
+
page_size: str = SENTINEL,
|
|
346
|
+
page_token: str = SENTINEL,
|
|
347
|
+
request_options: Optional[RequestOptions] = None,
|
|
348
|
+
) -> AsyncPager[ApiKeyMetadata]: # type: ignore[override]
|
|
349
|
+
sync_pager = super().list(
|
|
350
|
+
**dict[str, Any](
|
|
351
|
+
{
|
|
352
|
+
k: v
|
|
353
|
+
for k, v in {
|
|
354
|
+
"page_size": page_size,
|
|
355
|
+
"page_token": page_token,
|
|
356
|
+
}.items()
|
|
357
|
+
if v is not SENTINEL
|
|
358
|
+
}
|
|
359
|
+
),
|
|
360
|
+
request_options=request_options,
|
|
361
|
+
)
|
|
362
|
+
|
|
363
|
+
async def _paginate():
|
|
364
|
+
pages = sync_pager.iter_pages()
|
|
365
|
+
while True:
|
|
366
|
+
page = await to_async(next)(pages, None)
|
|
367
|
+
if page is None:
|
|
368
|
+
return
|
|
369
|
+
yield page
|
|
370
|
+
|
|
371
|
+
return AsyncPager(_paginate(), lambda: sync_pager.last_response)
|
|
372
|
+
|
|
373
|
+
def create(
|
|
374
|
+
self,
|
|
375
|
+
*,
|
|
376
|
+
name: str,
|
|
377
|
+
expires_at: Union[str, None] = SENTINEL,
|
|
378
|
+
request_options: Optional[RequestOptions] = None,
|
|
379
|
+
) -> Awaitable[ApiKeyCreated]: # type: ignore[override]
|
|
380
|
+
return to_async(super().create)(
|
|
381
|
+
name=name,
|
|
382
|
+
**dict[str, Any](
|
|
383
|
+
{
|
|
384
|
+
k: v
|
|
385
|
+
for k, v in {"expires_at": expires_at}.items()
|
|
386
|
+
if v is not SENTINEL
|
|
387
|
+
}
|
|
388
|
+
),
|
|
389
|
+
request_options=request_options,
|
|
390
|
+
)
|
|
391
|
+
|
|
392
|
+
def revoke(
|
|
393
|
+
self, key_id: str, *, request_options: Optional[RequestOptions] = None
|
|
394
|
+
) -> Awaitable[bool]: # type: ignore[override]
|
|
395
|
+
return to_async(super().revoke)(key_id, request_options=request_options)
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
class AsyncRawApiKeysClient:
|
|
399
|
+
"""
|
|
400
|
+
Async raw-response client for AsyncApiKeysClient.
|
|
401
|
+
"""
|
|
402
|
+
|
|
403
|
+
def __init__(self, client: AsyncApiKeysClient):
|
|
404
|
+
self._client = client
|
|
405
|
+
self._client_wrapper = client._client_wrapper
|
|
406
|
+
|
|
407
|
+
def list(
|
|
408
|
+
self,
|
|
409
|
+
*,
|
|
410
|
+
page_size: str = SENTINEL,
|
|
411
|
+
page_token: str = SENTINEL,
|
|
412
|
+
request_options: Optional[RequestOptions] = None,
|
|
413
|
+
) -> HttpResponse[AsyncPager[ApiKeyMetadata]]:
|
|
414
|
+
data = AsyncApiKeysClient.list(
|
|
415
|
+
self._client,
|
|
416
|
+
**dict[str, Any](
|
|
417
|
+
{
|
|
418
|
+
k: v
|
|
419
|
+
for k, v in {
|
|
420
|
+
"page_size": page_size,
|
|
421
|
+
"page_token": page_token,
|
|
422
|
+
}.items()
|
|
423
|
+
if v is not SENTINEL
|
|
424
|
+
}
|
|
425
|
+
),
|
|
426
|
+
request_options=request_options,
|
|
427
|
+
)
|
|
428
|
+
return HttpResponse(data=data, response_source=lambda: data.last_response)
|
|
429
|
+
|
|
430
|
+
async def create(
|
|
431
|
+
self,
|
|
432
|
+
*,
|
|
433
|
+
name: str,
|
|
434
|
+
expires_at: Union[str, None] = SENTINEL,
|
|
435
|
+
request_options: Optional[RequestOptions] = None,
|
|
436
|
+
) -> HttpResponse[ApiKeyCreated]:
|
|
437
|
+
data = await AsyncApiKeysClient.create(
|
|
438
|
+
self._client,
|
|
439
|
+
name=name,
|
|
440
|
+
**dict[str, Any](
|
|
441
|
+
{
|
|
442
|
+
k: v
|
|
443
|
+
for k, v in {"expires_at": expires_at}.items()
|
|
444
|
+
if v is not SENTINEL
|
|
445
|
+
}
|
|
446
|
+
),
|
|
447
|
+
request_options=request_options,
|
|
448
|
+
)
|
|
449
|
+
return HttpResponse(data=data, response=self._client._last_response)
|
|
450
|
+
|
|
451
|
+
async def revoke(
|
|
452
|
+
self, key_id: str, *, request_options: Optional[RequestOptions] = None
|
|
453
|
+
) -> HttpResponse[bool]:
|
|
454
|
+
data = await AsyncApiKeysClient.revoke(
|
|
455
|
+
self._client, key_id, request_options=request_options
|
|
456
|
+
)
|
|
457
|
+
return HttpResponse(data=data, response=self._client._last_response)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from .api_keys_list_bad_request_response import (
|
|
2
|
+
ApiKeysListBadRequestResponse,
|
|
3
|
+
ApiKeysListBadRequestResponse_BadRequest,
|
|
4
|
+
ApiKeysListBadRequestResponse_InvalidPageSize,
|
|
5
|
+
ApiKeysListBadRequestResponse_InvalidPageToken,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"ApiKeysListBadRequestResponse",
|
|
10
|
+
"ApiKeysListBadRequestResponse_BadRequest",
|
|
11
|
+
"ApiKeysListBadRequestResponse_InvalidPageSize",
|
|
12
|
+
"ApiKeysListBadRequestResponse_InvalidPageToken",
|
|
13
|
+
]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from ...types import (
|
|
2
|
+
ApiKeysListBadRequestResponse,
|
|
3
|
+
ApiKeysListBadRequestResponse_BadRequest,
|
|
4
|
+
ApiKeysListBadRequestResponse_InvalidPageSize,
|
|
5
|
+
ApiKeysListBadRequestResponse_InvalidPageToken,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"ApiKeysListBadRequestResponse",
|
|
10
|
+
"ApiKeysListBadRequestResponse_BadRequest",
|
|
11
|
+
"ApiKeysListBadRequestResponse_InvalidPageSize",
|
|
12
|
+
"ApiKeysListBadRequestResponse_InvalidPageToken",
|
|
13
|
+
]
|