anyscale 0.24.86__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.
- anyscale/__init__.py +181 -0
- anyscale/_private/anyscale_client/README.md +16 -0
- anyscale/_private/anyscale_client/__init__.py +8 -0
- anyscale/_private/anyscale_client/anyscale_client.py +1847 -0
- anyscale/_private/anyscale_client/common.py +593 -0
- anyscale/_private/anyscale_client/fake_anyscale_client.py +1080 -0
- anyscale/_private/docgen/README.md +15 -0
- anyscale/_private/docgen/__main__.py +700 -0
- anyscale/_private/docgen/api.md +1106 -0
- anyscale/_private/docgen/generator.py +559 -0
- anyscale/_private/docgen/generator_legacy.py +104 -0
- anyscale/_private/docgen/models.md +2261 -0
- anyscale/_private/models/__init__.py +2 -0
- anyscale/_private/models/image_uri.py +116 -0
- anyscale/_private/models/model_base.py +251 -0
- anyscale/_private/sdk/__init__.py +102 -0
- anyscale/_private/sdk/base_sdk.py +35 -0
- anyscale/_private/sdk/timer.py +46 -0
- anyscale/_private/utils/__init__.py +0 -0
- anyscale/_private/utils/progress_util.py +85 -0
- anyscale/_private/workload/__init__.py +2 -0
- anyscale/_private/workload/workload_config.py +195 -0
- anyscale/_private/workload/workload_sdk.py +324 -0
- anyscale/aggregated_instance_usage/__init__.py +36 -0
- anyscale/aggregated_instance_usage/_private/aggregated_instance_usage_sdk.py +30 -0
- anyscale/aggregated_instance_usage/commands.py +42 -0
- anyscale/aggregated_instance_usage/models.py +85 -0
- anyscale/anyscale-cloud-setup-gcp-oa.yaml +88 -0
- anyscale/anyscale-cloud-setup-gcp.yaml +113 -0
- anyscale/anyscale-cloud-setup-oa.yaml +121 -0
- anyscale/anyscale-cloud-setup.yaml +327 -0
- anyscale/anyscale_pydantic/HISTORY.md +1254 -0
- anyscale/anyscale_pydantic/LICENSE +21 -0
- anyscale/anyscale_pydantic/PKG-INFO +1351 -0
- anyscale/anyscale_pydantic/README.md +7 -0
- anyscale/anyscale_pydantic/__init__.py +131 -0
- anyscale/anyscale_pydantic/_hypothesis_plugin.py +391 -0
- anyscale/anyscale_pydantic/annotated_types.py +72 -0
- anyscale/anyscale_pydantic/class_validators.py +361 -0
- anyscale/anyscale_pydantic/color.py +494 -0
- anyscale/anyscale_pydantic/config.py +191 -0
- anyscale/anyscale_pydantic/dataclasses.py +478 -0
- anyscale/anyscale_pydantic/datetime_parse.py +248 -0
- anyscale/anyscale_pydantic/decorator.py +264 -0
- anyscale/anyscale_pydantic/env_settings.py +350 -0
- anyscale/anyscale_pydantic/error_wrappers.py +162 -0
- anyscale/anyscale_pydantic/errors.py +646 -0
- anyscale/anyscale_pydantic/fields.py +1256 -0
- anyscale/anyscale_pydantic/generics.py +400 -0
- anyscale/anyscale_pydantic/json.py +112 -0
- anyscale/anyscale_pydantic/main.py +1109 -0
- anyscale/anyscale_pydantic/mypy.py +943 -0
- anyscale/anyscale_pydantic/networks.py +739 -0
- anyscale/anyscale_pydantic/parse.py +66 -0
- anyscale/anyscale_pydantic/py.typed +0 -0
- anyscale/anyscale_pydantic/schema.py +1164 -0
- anyscale/anyscale_pydantic/tools.py +92 -0
- anyscale/anyscale_pydantic/types.py +1206 -0
- anyscale/anyscale_pydantic/typing.py +603 -0
- anyscale/anyscale_pydantic/utils.py +803 -0
- anyscale/anyscale_pydantic/validators.py +765 -0
- anyscale/anyscale_pydantic/version.py +38 -0
- anyscale/anyscale_schema.json +9 -0
- anyscale/api.py +215 -0
- anyscale/api_utils/README.md +2 -0
- anyscale/api_utils/__init__.py +0 -0
- anyscale/api_utils/common_utils.py +81 -0
- anyscale/api_utils/exceptions/__init__.py +0 -0
- anyscale/api_utils/exceptions/job_errors.py +2 -0
- anyscale/api_utils/job_logs_util.py +116 -0
- anyscale/api_utils/job_util.py +22 -0
- anyscale/api_utils/logs_util.py +61 -0
- anyscale/authenticate.py +298 -0
- anyscale/aws_iam_policies.py +465 -0
- anyscale/background/__init__.py +0 -0
- anyscale/background/job_runner.py +64 -0
- anyscale/cli_logger.py +378 -0
- anyscale/client/.gitignore +66 -0
- anyscale/client/.openapi-generator/VERSION +1 -0
- anyscale/client/.openapi-generator-ignore +23 -0
- anyscale/client/README.md +1070 -0
- anyscale/client/git_push.sh +58 -0
- anyscale/client/openapi_client/__init__.py +667 -0
- anyscale/client/openapi_client/api/__init__.py +6 -0
- anyscale/client/openapi_client/api/default_api.py +40922 -0
- anyscale/client/openapi_client/api_client.py +647 -0
- anyscale/client/openapi_client/configuration.py +373 -0
- anyscale/client/openapi_client/exceptions.py +120 -0
- anyscale/client/openapi_client/models/__init__.py +652 -0
- anyscale/client/openapi_client/models/access_config.py +122 -0
- anyscale/client/openapi_client/models/aggregated_instance_usage_with_cost_model.py +733 -0
- anyscale/client/openapi_client/models/aggregatedinstanceusagewithcostmodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/aica_endpoint.py +527 -0
- anyscale/client/openapi_client/models/aica_endpoint_event.py +433 -0
- anyscale/client/openapi_client/models/aica_endpoint_event_level.py +103 -0
- anyscale/client/openapi_client/models/aica_endpoint_event_type.py +120 -0
- anyscale/client/openapi_client/models/aica_endpoint_scope.py +102 -0
- anyscale/client/openapi_client/models/aica_model.py +398 -0
- anyscale/client/openapi_client/models/aica_model_accelerator_map.py +123 -0
- anyscale/client/openapi_client/models/aica_model_configuration.py +209 -0
- anyscale/client/openapi_client/models/aica_observability_urls.py +178 -0
- anyscale/client/openapi_client/models/aicaendpoint_list_response.py +147 -0
- anyscale/client/openapi_client/models/aicaendpoint_response.py +121 -0
- anyscale/client/openapi_client/models/aicaendpointevent_list_response.py +147 -0
- anyscale/client/openapi_client/models/aicamodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/aicamodel_response.py +121 -0
- anyscale/client/openapi_client/models/aioa_cloud_waitlist_record.py +254 -0
- anyscale/client/openapi_client/models/aioacloudwaitlistrecord_response.py +121 -0
- anyscale/client/openapi_client/models/alert_type.py +103 -0
- anyscale/client/openapi_client/models/anyscale_aws_account.py +121 -0
- anyscale/client/openapi_client/models/anyscale_service_account.py +256 -0
- anyscale/client/openapi_client/models/anyscale_version_response.py +121 -0
- anyscale/client/openapi_client/models/anyscaleawsaccount_response.py +121 -0
- anyscale/client/openapi_client/models/anyscaled_credential_response.py +121 -0
- anyscale/client/openapi_client/models/anyscaledcredentialresponse_response.py +121 -0
- anyscale/client/openapi_client/models/anyscaleserviceaccount_response.py +121 -0
- anyscale/client/openapi_client/models/anyscaleversionresponse_response.py +121 -0
- anyscale/client/openapi_client/models/api_key_parameters.py +147 -0
- anyscale/client/openapi_client/models/app_config.py +436 -0
- anyscale/client/openapi_client/models/app_config_config_schema.py +235 -0
- anyscale/client/openapi_client/models/appconfig_list_response.py +147 -0
- anyscale/client/openapi_client/models/appconfig_response.py +121 -0
- anyscale/client/openapi_client/models/application_type.py +99 -0
- anyscale/client/openapi_client/models/applied_snapshot.py +175 -0
- anyscale/client/openapi_client/models/apply_production_service_v2_model.py +490 -0
- anyscale/client/openapi_client/models/archive_status.py +101 -0
- anyscale/client/openapi_client/models/archived_logs_info.py +164 -0
- anyscale/client/openapi_client/models/archivedlogsinfo_response.py +121 -0
- anyscale/client/openapi_client/models/attach_machine_pool_to_cloud_request.py +152 -0
- anyscale/client/openapi_client/models/attachmachinepooltocloudresponse_response.py +121 -0
- anyscale/client/openapi_client/models/aviary_model_config_v2.py +358 -0
- anyscale/client/openapi_client/models/aws_credentials.py +181 -0
- anyscale/client/openapi_client/models/aws_memory_db_cluster_config.py +148 -0
- anyscale/client/openapi_client/models/aws_region_and_zones.py +123 -0
- anyscale/client/openapi_client/models/aws_region_info.py +152 -0
- anyscale/client/openapi_client/models/awsregionandzones_response.py +121 -0
- anyscale/client/openapi_client/models/bank_account_information.py +239 -0
- anyscale/client/openapi_client/models/base_job_status.py +105 -0
- anyscale/client/openapi_client/models/baseimagesenum.py +2130 -0
- anyscale/client/openapi_client/models/batch_response_batched_result_organization_invitation_base.py +121 -0
- anyscale/client/openapi_client/models/batched_result_organization_invitation_base.py +173 -0
- anyscale/client/openapi_client/models/billing_information.py +181 -0
- anyscale/client/openapi_client/models/billing_version_code.py +100 -0
- anyscale/client/openapi_client/models/body_aws_marketplace_registration_api_v2_organization_billing_aws_marketplace_registration_post.py +121 -0
- anyscale/client/openapi_client/models/buffer_registration.py +285 -0
- anyscale/client/openapi_client/models/build.py +607 -0
- anyscale/client/openapi_client/models/build_log_response.py +123 -0
- anyscale/client/openapi_client/models/build_registration.py +285 -0
- anyscale/client/openapi_client/models/build_response.py +121 -0
- anyscale/client/openapi_client/models/build_status.py +104 -0
- anyscale/client/openapi_client/models/buildlogresponse_response.py +121 -0
- anyscale/client/openapi_client/models/card.py +181 -0
- anyscale/client/openapi_client/models/card_id.py +108 -0
- anyscale/client/openapi_client/models/card_list_response.py +147 -0
- anyscale/client/openapi_client/models/change_password_params.py +148 -0
- anyscale/client/openapi_client/models/cleanup_leaked_grafana_dashboard_response.py +208 -0
- anyscale/client/openapi_client/models/cleanupleakedgrafanadashboardresponse_response.py +121 -0
- anyscale/client/openapi_client/models/clone_experimental_workspace.py +151 -0
- anyscale/client/openapi_client/models/cloud.py +802 -0
- anyscale/client/openapi_client/models/cloud_analytics_event.py +351 -0
- anyscale/client/openapi_client/models/cloud_analytics_event_cloud_provider_error.py +152 -0
- anyscale/client/openapi_client/models/cloud_analytics_event_cloud_resource.py +117 -0
- anyscale/client/openapi_client/models/cloud_analytics_event_command_name.py +103 -0
- anyscale/client/openapi_client/models/cloud_analytics_event_error.py +150 -0
- anyscale/client/openapi_client/models/cloud_analytics_event_name.py +109 -0
- anyscale/client/openapi_client/models/cloud_collaborator.py +175 -0
- anyscale/client/openapi_client/models/cloud_collaborator_value.py +177 -0
- anyscale/client/openapi_client/models/cloud_collaborators_query.py +122 -0
- anyscale/client/openapi_client/models/cloud_config.py +206 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_access_mode.py +100 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_file_type.py +102 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_presigned_upload_info.py +268 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_presigned_upload_request.py +152 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_presigned_upload_scheme.py +100 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_presigned_url_request.py +209 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_presigned_url_response.py +296 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_presigned_url_scheme.py +100 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_request_scope.py +100 -0
- anyscale/client/openapi_client/models/cloud_hosting_type.py +100 -0
- anyscale/client/openapi_client/models/cloud_list_response.py +147 -0
- anyscale/client/openapi_client/models/cloud_name_options.py +121 -0
- anyscale/client/openapi_client/models/cloud_overview_dashboard.py +175 -0
- anyscale/client/openapi_client/models/cloud_project_collaborator.py +175 -0
- anyscale/client/openapi_client/models/cloud_project_collaborator_value.py +121 -0
- anyscale/client/openapi_client/models/cloud_provider.py +102 -0
- anyscale/client/openapi_client/models/cloud_providers.py +103 -0
- anyscale/client/openapi_client/models/cloud_region_and_zones.py +123 -0
- anyscale/client/openapi_client/models/cloud_region_info.py +152 -0
- anyscale/client/openapi_client/models/cloud_resource.py +740 -0
- anyscale/client/openapi_client/models/cloud_resource_gcp.py +691 -0
- anyscale/client/openapi_client/models/cloud_response.py +121 -0
- anyscale/client/openapi_client/models/cloud_state.py +104 -0
- anyscale/client/openapi_client/models/cloud_status.py +100 -0
- anyscale/client/openapi_client/models/cloud_type.py +100 -0
- anyscale/client/openapi_client/models/cloud_types.py +100 -0
- anyscale/client/openapi_client/models/cloud_version.py +100 -0
- anyscale/client/openapi_client/models/cloud_waitlist_status.py +102 -0
- anyscale/client/openapi_client/models/cloud_with_cloud_resource.py +830 -0
- anyscale/client/openapi_client/models/cloud_with_cloud_resource_gcp.py +830 -0
- anyscale/client/openapi_client/models/cloudcollaborator_list_response.py +147 -0
- anyscale/client/openapi_client/models/clouddatabucketpresigneduploadinfo_response.py +121 -0
- anyscale/client/openapi_client/models/clouddatabucketpresignedurlresponse_response.py +121 -0
- anyscale/client/openapi_client/models/cloudoverviewdashboard_response.py +121 -0
- anyscale/client/openapi_client/models/cloudregionandzones_response.py +121 -0
- anyscale/client/openapi_client/models/cloudresource_response.py +121 -0
- anyscale/client/openapi_client/models/cloudresourcegcp_response.py +121 -0
- anyscale/client/openapi_client/models/cloudwithcloudresource_response.py +121 -0
- anyscale/client/openapi_client/models/cloudwithcloudresourcegcp_response.py +121 -0
- anyscale/client/openapi_client/models/cluster_auth_response.py +148 -0
- anyscale/client/openapi_client/models/cluster_config.py +178 -0
- anyscale/client/openapi_client/models/cluster_config_with_session_idle_timeout.py +204 -0
- anyscale/client/openapi_client/models/cluster_environments_query.py +290 -0
- anyscale/client/openapi_client/models/cluster_event.py +174 -0
- anyscale/client/openapi_client/models/cluster_events_output.py +175 -0
- anyscale/client/openapi_client/models/cluster_features.py +152 -0
- anyscale/client/openapi_client/models/cluster_management_stack_versions.py +100 -0
- anyscale/client/openapi_client/models/cluster_startup.py +208 -0
- anyscale/client/openapi_client/models/cluster_status.py +104 -0
- anyscale/client/openapi_client/models/cluster_status_details.py +100 -0
- anyscale/client/openapi_client/models/clusterauthresponse_response.py +121 -0
- anyscale/client/openapi_client/models/clusterconfig_response.py +121 -0
- anyscale/client/openapi_client/models/clusterconfigwithsessionidletimeout_response.py +121 -0
- anyscale/client/openapi_client/models/clustereventsoutput_response.py +121 -0
- anyscale/client/openapi_client/models/clusterfeatures_response.py +121 -0
- anyscale/client/openapi_client/models/company_size.py +103 -0
- anyscale/client/openapi_client/models/compute_node_type.py +292 -0
- anyscale/client/openapi_client/models/compute_stack.py +100 -0
- anyscale/client/openapi_client/models/compute_template.py +415 -0
- anyscale/client/openapi_client/models/compute_template_config.py +461 -0
- anyscale/client/openapi_client/models/compute_template_query.py +316 -0
- anyscale/client/openapi_client/models/computetemplate_response.py +121 -0
- anyscale/client/openapi_client/models/computetemplateconfig_response.py +121 -0
- anyscale/client/openapi_client/models/create_aica_endpoint.py +210 -0
- anyscale/client/openapi_client/models/create_aioa_cloud_waitlist.py +173 -0
- anyscale/client/openapi_client/models/create_analytics_event.py +122 -0
- anyscale/client/openapi_client/models/create_app_config.py +235 -0
- anyscale/client/openapi_client/models/create_app_config_configuration_schema.py +235 -0
- anyscale/client/openapi_client/models/create_billing_version.py +181 -0
- anyscale/client/openapi_client/models/create_bug_report_response.py +152 -0
- anyscale/client/openapi_client/models/create_build.py +263 -0
- anyscale/client/openapi_client/models/create_byod_app_config.py +180 -0
- anyscale/client/openapi_client/models/create_byod_app_config_configuration_schema.py +206 -0
- anyscale/client/openapi_client/models/create_byod_build.py +152 -0
- anyscale/client/openapi_client/models/create_cloud_collaborator.py +148 -0
- anyscale/client/openapi_client/models/create_cloud_resource.py +682 -0
- anyscale/client/openapi_client/models/create_cloud_resource_gcp.py +633 -0
- anyscale/client/openapi_client/models/create_cloud_with_cloud_resource.py +546 -0
- anyscale/client/openapi_client/models/create_cluster_compute_config.py +463 -0
- anyscale/client/openapi_client/models/create_compute_template.py +229 -0
- anyscale/client/openapi_client/models/create_compute_template_config.py +464 -0
- anyscale/client/openapi_client/models/create_dataset.py +200 -0
- anyscale/client/openapi_client/models/create_experimental_workspace.py +435 -0
- anyscale/client/openapi_client/models/create_experimental_workspace_from_job.py +123 -0
- anyscale/client/openapi_client/models/create_fine_tuning_hyperparameters.py +156 -0
- anyscale/client/openapi_client/models/create_fine_tuning_job_product_request.py +353 -0
- anyscale/client/openapi_client/models/create_instance_usage_budget.py +253 -0
- anyscale/client/openapi_client/models/create_internal_production_job.py +262 -0
- anyscale/client/openapi_client/models/create_job_queue_config.py +206 -0
- anyscale/client/openapi_client/models/create_job_queue_requests.py +323 -0
- anyscale/client/openapi_client/models/create_machine_pool_request.py +151 -0
- anyscale/client/openapi_client/models/create_machine_pool_response.py +123 -0
- anyscale/client/openapi_client/models/create_machine_request.py +151 -0
- anyscale/client/openapi_client/models/create_machine_response.py +123 -0
- anyscale/client/openapi_client/models/create_metronome_webhook_notification.py +175 -0
- anyscale/client/openapi_client/models/create_notification_channel_record.py +146 -0
- anyscale/client/openapi_client/models/create_organization_configuration.py +199 -0
- anyscale/client/openapi_client/models/create_organization_invitation.py +121 -0
- anyscale/client/openapi_client/models/create_otp_return_api_model.py +148 -0
- anyscale/client/openapi_client/models/create_production_job_config.py +347 -0
- anyscale/client/openapi_client/models/create_resource_quota.py +293 -0
- anyscale/client/openapi_client/models/create_schedule.py +263 -0
- anyscale/client/openapi_client/models/create_session_from_snapshot_options.py +565 -0
- anyscale/client/openapi_client/models/create_session_in_db.py +434 -0
- anyscale/client/openapi_client/models/create_session_response.py +174 -0
- anyscale/client/openapi_client/models/create_user.py +439 -0
- anyscale/client/openapi_client/models/create_user_project_collaborator.py +148 -0
- anyscale/client/openapi_client/models/create_user_project_collaborator_value.py +121 -0
- anyscale/client/openapi_client/models/create_workspace_from_template.py +263 -0
- anyscale/client/openapi_client/models/createbugreportresponse_response.py +121 -0
- anyscale/client/openapi_client/models/createcomputetemplateconfig_response.py +121 -0
- anyscale/client/openapi_client/models/createmachinepoolresponse_response.py +121 -0
- anyscale/client/openapi_client/models/createmachineresponse_response.py +121 -0
- anyscale/client/openapi_client/models/createotpreturnapimodel_response.py +121 -0
- anyscale/client/openapi_client/models/createsessionresponse_response.py +121 -0
- anyscale/client/openapi_client/models/credit_card_information.py +268 -0
- anyscale/client/openapi_client/models/customer_alert_status.py +101 -0
- anyscale/client/openapi_client/models/customer_billing_type.py +101 -0
- anyscale/client/openapi_client/models/dataplane_services.py +102 -0
- anyscale/client/openapi_client/models/dataset.py +416 -0
- anyscale/client/openapi_client/models/dataset_list_response.py +150 -0
- anyscale/client/openapi_client/models/dataset_response.py +121 -0
- anyscale/client/openapi_client/models/dataset_upload.py +148 -0
- anyscale/client/openapi_client/models/datasetupload_response.py +121 -0
- anyscale/client/openapi_client/models/decorated_application_template.py +493 -0
- anyscale/client/openapi_client/models/decorated_build.py +664 -0
- anyscale/client/openapi_client/models/decorated_compute_template.py +446 -0
- anyscale/client/openapi_client/models/decorated_compute_template_config.py +490 -0
- anyscale/client/openapi_client/models/decorated_interactive_session.py +793 -0
- anyscale/client/openapi_client/models/decorated_job.py +793 -0
- anyscale/client/openapi_client/models/decorated_job_queue.py +639 -0
- anyscale/client/openapi_client/models/decorated_job_submission.py +575 -0
- anyscale/client/openapi_client/models/decorated_list_service_api_model.py +670 -0
- anyscale/client/openapi_client/models/decorated_production_job.py +805 -0
- anyscale/client/openapi_client/models/decorated_production_job_state_transition.py +319 -0
- anyscale/client/openapi_client/models/decorated_production_service_v2_api_model.py +641 -0
- anyscale/client/openapi_client/models/decorated_production_service_v2_version_api_model.py +437 -0
- anyscale/client/openapi_client/models/decorated_runtime_env.py +488 -0
- anyscale/client/openapi_client/models/decorated_schedule.py +552 -0
- anyscale/client/openapi_client/models/decorated_serve_deployment.py +711 -0
- anyscale/client/openapi_client/models/decorated_service_event_api_model.py +513 -0
- anyscale/client/openapi_client/models/decorated_session.py +1789 -0
- anyscale/client/openapi_client/models/decorated_support_request.py +283 -0
- anyscale/client/openapi_client/models/decorated_unified_job.py +466 -0
- anyscale/client/openapi_client/models/decoratedapplicationtemplate_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedapplicationtemplate_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedbuild_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedbuild_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedcomputetemplate_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedcomputetemplate_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedinteractivesession_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedinteractivesession_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedjob_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedjob_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedjobqueue_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedjobqueue_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedjobsubmission_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedjobsubmission_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedlistserviceapimodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedproductionjob_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedproductionjob_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedproductionjobstatetransition_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedproductionservicev2_apimodel_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedproductionservicev2_versionapimodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedruntimeenv_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedruntimeenv_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedschedule_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedschedule_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedservedeployment_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedservedeployment_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedserviceeventapimodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedsession_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedsession_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedsupportrequest_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedsupportrequest_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedunifiedjob_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedunifiedjob_response.py +121 -0
- anyscale/client/openapi_client/models/delete_machine_pool_request.py +123 -0
- anyscale/client/openapi_client/models/delete_machine_request.py +206 -0
- anyscale/client/openapi_client/models/deleted_platform_fine_tuned_model.py +148 -0
- anyscale/client/openapi_client/models/deletedplatformfinetunedmodel_response.py +121 -0
- anyscale/client/openapi_client/models/deletemachinepoolresponse_response.py +121 -0
- anyscale/client/openapi_client/models/detach_machine_pool_from_cloud_request.py +152 -0
- anyscale/client/openapi_client/models/detachmachinepoolfromcloudresponse_response.py +121 -0
- anyscale/client/openapi_client/models/dismissal_type.py +100 -0
- anyscale/client/openapi_client/models/editable_cloud_resource.py +206 -0
- anyscale/client/openapi_client/models/editable_cloud_resource_gcp.py +178 -0
- anyscale/client/openapi_client/models/error.py +174 -0
- anyscale/client/openapi_client/models/event_level.py +104 -0
- anyscale/client/openapi_client/models/execute_command_response.py +175 -0
- anyscale/client/openapi_client/models/execute_interactive_command_options.py +147 -0
- anyscale/client/openapi_client/models/execute_shell_command_options.py +121 -0
- anyscale/client/openapi_client/models/executecommandresponse_response.py +121 -0
- anyscale/client/openapi_client/models/experimental_workspace.py +748 -0
- anyscale/client/openapi_client/models/experimental_workspaces_sort_field.py +100 -0
- anyscale/client/openapi_client/models/experimentalworkspace_list_response.py +147 -0
- anyscale/client/openapi_client/models/experimentalworkspace_response.py +121 -0
- anyscale/client/openapi_client/models/external_service_status.py +147 -0
- anyscale/client/openapi_client/models/external_service_status_response.py +250 -0
- anyscale/client/openapi_client/models/external_terminal_command.py +280 -0
- anyscale/client/openapi_client/models/externalservicestatusresponse_response.py +121 -0
- anyscale/client/openapi_client/models/feature_compatibility.py +152 -0
- anyscale/client/openapi_client/models/feature_flag_response.py +121 -0
- anyscale/client/openapi_client/models/featureflagresponse_response.py +121 -0
- anyscale/client/openapi_client/models/fine_tune_type.py +100 -0
- anyscale/client/openapi_client/models/fine_tuned_model.py +412 -0
- anyscale/client/openapi_client/models/fine_tuning_job_status.py +103 -0
- anyscale/client/openapi_client/models/finetunedmodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/finetunedmodel_response.py +121 -0
- anyscale/client/openapi_client/models/finish_ft_job_request.py +204 -0
- anyscale/client/openapi_client/models/finish_ft_job_request_v2.py +183 -0
- anyscale/client/openapi_client/models/gcp_file_store_config.py +175 -0
- anyscale/client/openapi_client/models/gcp_memorystore_instance_config.py +148 -0
- anyscale/client/openapi_client/models/grafana_dashboard.py +201 -0
- anyscale/client/openapi_client/models/grpc_protocol_config.py +178 -0
- anyscale/client/openapi_client/models/ha_job_error_types.py +103 -0
- anyscale/client/openapi_client/models/ha_job_event_level.py +101 -0
- anyscale/client/openapi_client/models/ha_job_event_origin.py +100 -0
- anyscale/client/openapi_client/models/ha_job_goal_states.py +102 -0
- anyscale/client/openapi_client/models/ha_job_states.py +109 -0
- anyscale/client/openapi_client/models/ha_job_type.py +100 -0
- anyscale/client/openapi_client/models/ha_jobs_sort_field.py +105 -0
- anyscale/client/openapi_client/models/head_ip.py +121 -0
- anyscale/client/openapi_client/models/headip_response.py +121 -0
- anyscale/client/openapi_client/models/http_protocol_config.py +150 -0
- anyscale/client/openapi_client/models/http_validation_error.py +120 -0
- anyscale/client/openapi_client/models/idle_termination_status.py +104 -0
- anyscale/client/openapi_client/models/import_aica_model.py +241 -0
- anyscale/client/openapi_client/models/instance_usage_budget.py +572 -0
- anyscale/client/openapi_client/models/instance_usage_budget_evaluation_period.py +100 -0
- anyscale/client/openapi_client/models/instanceusagebudget_list_response.py +147 -0
- anyscale/client/openapi_client/models/instanceusagebudget_response.py +121 -0
- anyscale/client/openapi_client/models/integration_details.py +120 -0
- anyscale/client/openapi_client/models/interactive_session_logs.py +152 -0
- anyscale/client/openapi_client/models/interactivesessionlogs_response.py +121 -0
- anyscale/client/openapi_client/models/internal_production_job.py +663 -0
- anyscale/client/openapi_client/models/internalproductionjob_response.py +121 -0
- anyscale/client/openapi_client/models/invoice.py +413 -0
- anyscale/client/openapi_client/models/invoice_list_response.py +147 -0
- anyscale/client/openapi_client/models/invoice_status.py +102 -0
- anyscale/client/openapi_client/models/invoices_query.py +150 -0
- anyscale/client/openapi_client/models/job_access.py +102 -0
- anyscale/client/openapi_client/models/job_queue.py +467 -0
- anyscale/client/openapi_client/models/job_queue_config.py +122 -0
- anyscale/client/openapi_client/models/job_queue_execution_mode.py +101 -0
- anyscale/client/openapi_client/models/job_queue_spec.py +263 -0
- anyscale/client/openapi_client/models/job_queue_state.py +100 -0
- anyscale/client/openapi_client/models/job_queues_query.py +262 -0
- anyscale/client/openapi_client/models/job_run_type.py +101 -0
- anyscale/client/openapi_client/models/job_state_log_level_types.py +100 -0
- anyscale/client/openapi_client/models/job_status.py +105 -0
- anyscale/client/openapi_client/models/job_submissions_sort_field.py +101 -0
- anyscale/client/openapi_client/models/jobqueue_response.py +121 -0
- anyscale/client/openapi_client/models/jobs_logs.py +152 -0
- anyscale/client/openapi_client/models/jobs_logs_query_info.py +181 -0
- anyscale/client/openapi_client/models/jobs_sort_field.py +104 -0
- anyscale/client/openapi_client/models/jobslogs_response.py +121 -0
- anyscale/client/openapi_client/models/jobslogsqueryinfo_response.py +121 -0
- anyscale/client/openapi_client/models/json_patch_operation.py +200 -0
- anyscale/client/openapi_client/models/kubernetes_manager_registration_request.py +123 -0
- anyscale/client/openapi_client/models/kubernetes_manager_registration_response.py +123 -0
- anyscale/client/openapi_client/models/kubernetesmanagerregistrationresponse_response.py +121 -0
- anyscale/client/openapi_client/models/lb_resource.py +123 -0
- anyscale/client/openapi_client/models/lbresource_response.py +121 -0
- anyscale/client/openapi_client/models/list_machine_pools_response.py +123 -0
- anyscale/client/openapi_client/models/list_machines_response.py +121 -0
- anyscale/client/openapi_client/models/list_resource_quotas_query.py +234 -0
- anyscale/client/openapi_client/models/list_response_metadata.py +146 -0
- anyscale/client/openapi_client/models/listmachinepoolsresponse_response.py +121 -0
- anyscale/client/openapi_client/models/listmachinesresponse_response.py +121 -0
- anyscale/client/openapi_client/models/log_detail.py +187 -0
- anyscale/client/openapi_client/models/log_details.py +151 -0
- anyscale/client/openapi_client/models/log_download_config.py +206 -0
- anyscale/client/openapi_client/models/log_download_request.py +150 -0
- anyscale/client/openapi_client/models/log_download_result.py +207 -0
- anyscale/client/openapi_client/models/log_file_chunk.py +439 -0
- anyscale/client/openapi_client/models/log_filter.py +430 -0
- anyscale/client/openapi_client/models/log_item.py +181 -0
- anyscale/client/openapi_client/models/log_item_batch.py +151 -0
- anyscale/client/openapi_client/models/log_level_types.py +100 -0
- anyscale/client/openapi_client/models/log_stream.py +151 -0
- anyscale/client/openapi_client/models/logdetails_response.py +121 -0
- anyscale/client/openapi_client/models/logdownloadresult_response.py +121 -0
- anyscale/client/openapi_client/models/login_user_params.py +205 -0
- anyscale/client/openapi_client/models/logitembatch_response.py +121 -0
- anyscale/client/openapi_client/models/logs_output.py +202 -0
- anyscale/client/openapi_client/models/logsoutput_response.py +121 -0
- anyscale/client/openapi_client/models/logstream_response.py +121 -0
- anyscale/client/openapi_client/models/long_running_workload.py +256 -0
- anyscale/client/openapi_client/models/longrunningworkload_list_response.py +147 -0
- anyscale/client/openapi_client/models/machine_allocation_state.py +100 -0
- anyscale/client/openapi_client/models/machine_connection_state.py +100 -0
- anyscale/client/openapi_client/models/machine_info.py +466 -0
- anyscale/client/openapi_client/models/machine_pool.py +266 -0
- anyscale/client/openapi_client/models/metronome_customer_info_model.py +148 -0
- anyscale/client/openapi_client/models/metronome_dashboard_type.py +101 -0
- anyscale/client/openapi_client/models/metronomecustomerinfomodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/metronomecustomerinfomodel_response.py +121 -0
- anyscale/client/openapi_client/models/mini_build.py +267 -0
- anyscale/client/openapi_client/models/mini_cloud.py +321 -0
- anyscale/client/openapi_client/models/mini_cluster.py +148 -0
- anyscale/client/openapi_client/models/mini_compute_template.py +228 -0
- anyscale/client/openapi_client/models/mini_compute_template_config.py +121 -0
- anyscale/client/openapi_client/models/mini_job_run.py +599 -0
- anyscale/client/openapi_client/models/mini_namespace.py +148 -0
- anyscale/client/openapi_client/models/mini_organization.py +148 -0
- anyscale/client/openapi_client/models/mini_production_job.py +202 -0
- anyscale/client/openapi_client/models/mini_project.py +205 -0
- anyscale/client/openapi_client/models/mini_runtime_environment.py +147 -0
- anyscale/client/openapi_client/models/mini_schedule.py +180 -0
- anyscale/client/openapi_client/models/mini_user.py +266 -0
- anyscale/client/openapi_client/models/minibuild_list_response.py +147 -0
- anyscale/client/openapi_client/models/minicomputetemplate_list_response.py +147 -0
- anyscale/client/openapi_client/models/miniproject_list_response.py +147 -0
- anyscale/client/openapi_client/models/monitor_logs_extension.py +100 -0
- anyscale/client/openapi_client/models/named_entity.py +148 -0
- anyscale/client/openapi_client/models/nfs_mount_target.py +151 -0
- anyscale/client/openapi_client/models/node_registration_aws.py +152 -0
- anyscale/client/openapi_client/models/node_registration_gcp.py +123 -0
- anyscale/client/openapi_client/models/node_registration_k8_s.py +178 -0
- anyscale/client/openapi_client/models/node_registration_provisioned.py +150 -0
- anyscale/client/openapi_client/models/node_registration_v2.py +279 -0
- anyscale/client/openapi_client/models/node_type.py +100 -0
- anyscale/client/openapi_client/models/notification_channel_email_config.py +121 -0
- anyscale/client/openapi_client/models/notification_channel_webhook_config.py +121 -0
- anyscale/client/openapi_client/models/onboarding_user_cards_query.py +122 -0
- anyscale/client/openapi_client/models/organization.py +490 -0
- anyscale/client/openapi_client/models/organization_availability.py +148 -0
- anyscale/client/openapi_client/models/organization_collaborator.py +259 -0
- anyscale/client/openapi_client/models/organization_configuration.py +280 -0
- anyscale/client/openapi_client/models/organization_configuration_response.py +227 -0
- anyscale/client/openapi_client/models/organization_invitation.py +255 -0
- anyscale/client/openapi_client/models/organization_invitation_base.py +121 -0
- anyscale/client/openapi_client/models/organization_marketing_questions.py +198 -0
- anyscale/client/openapi_client/models/organization_permission_level.py +100 -0
- anyscale/client/openapi_client/models/organization_project_collaborator.py +175 -0
- anyscale/client/openapi_client/models/organization_project_collaborator_value.py +148 -0
- anyscale/client/openapi_client/models/organization_public_identifier.py +121 -0
- anyscale/client/openapi_client/models/organization_response.py +121 -0
- anyscale/client/openapi_client/models/organization_summary.py +229 -0
- anyscale/client/openapi_client/models/organization_usage_alert.py +210 -0
- anyscale/client/openapi_client/models/organization_usage_alert_severity.py +100 -0
- anyscale/client/openapi_client/models/organizationavailability_response.py +121 -0
- anyscale/client/openapi_client/models/organizationcollaborator_list_response.py +147 -0
- anyscale/client/openapi_client/models/organizationconfiguration_list_response.py +147 -0
- anyscale/client/openapi_client/models/organizationconfigurationresponse_response.py +121 -0
- anyscale/client/openapi_client/models/organizationinvitation_list_response.py +147 -0
- anyscale/client/openapi_client/models/organizationinvitation_response.py +121 -0
- anyscale/client/openapi_client/models/organizationinvitationbase_response.py +121 -0
- anyscale/client/openapi_client/models/organizationprojectcollaborator_list_response.py +147 -0
- anyscale/client/openapi_client/models/organizationpublicidentifier_response.py +121 -0
- anyscale/client/openapi_client/models/organizationusagealert_list_response.py +147 -0
- anyscale/client/openapi_client/models/page_query.py +153 -0
- anyscale/client/openapi_client/models/pause_schedule.py +123 -0
- anyscale/client/openapi_client/models/permission_level.py +101 -0
- anyscale/client/openapi_client/models/platform_fine_tuning_job.py +577 -0
- anyscale/client/openapi_client/models/platformfinetuningjob_list_response.py +147 -0
- anyscale/client/openapi_client/models/platformfinetuningjob_response.py +121 -0
- anyscale/client/openapi_client/models/product_autoscaler_flag.py +122 -0
- anyscale/client/openapi_client/models/product_type.py +100 -0
- anyscale/client/openapi_client/models/productautoscalerflag_response.py +121 -0
- anyscale/client/openapi_client/models/production_job.py +437 -0
- anyscale/client/openapi_client/models/production_job_config.py +348 -0
- anyscale/client/openapi_client/models/production_job_event.py +378 -0
- anyscale/client/openapi_client/models/production_job_event_scope_filter.py +101 -0
- anyscale/client/openapi_client/models/production_job_state_transition.py +293 -0
- anyscale/client/openapi_client/models/productionjob_response.py +121 -0
- anyscale/client/openapi_client/models/productionjobevent_list_response.py +147 -0
- anyscale/client/openapi_client/models/project.py +554 -0
- anyscale/client/openapi_client/models/project_base.py +121 -0
- anyscale/client/openapi_client/models/project_collaborator.py +175 -0
- anyscale/client/openapi_client/models/project_collaborator_value.py +175 -0
- anyscale/client/openapi_client/models/project_collaborators_put_message.py +121 -0
- anyscale/client/openapi_client/models/project_create_message.py +148 -0
- anyscale/client/openapi_client/models/project_default_session_name.py +121 -0
- anyscale/client/openapi_client/models/project_delete_message.py +121 -0
- anyscale/client/openapi_client/models/project_list_response.py +147 -0
- anyscale/client/openapi_client/models/project_patch_message.py +121 -0
- anyscale/client/openapi_client/models/project_response.py +121 -0
- anyscale/client/openapi_client/models/projectbase_response.py +121 -0
- anyscale/client/openapi_client/models/projectcollaborator_list_response.py +147 -0
- anyscale/client/openapi_client/models/projectdefaultsessionname_response.py +121 -0
- anyscale/client/openapi_client/models/projects_sort_field.py +101 -0
- anyscale/client/openapi_client/models/projects_violating_tree_hierarchy_response.py +121 -0
- anyscale/client/openapi_client/models/projectsviolatingtreehierarchyresponse_response.py +121 -0
- anyscale/client/openapi_client/models/protocols.py +150 -0
- anyscale/client/openapi_client/models/provider_metadata.py +205 -0
- anyscale/client/openapi_client/models/providermetadata_response.py +121 -0
- anyscale/client/openapi_client/models/python_modules.py +150 -0
- anyscale/client/openapi_client/models/quota.py +198 -0
- anyscale/client/openapi_client/models/ray_gcs_external_storage_config.py +178 -0
- anyscale/client/openapi_client/models/ray_runtime_env_config.py +262 -0
- anyscale/client/openapi_client/models/read_billing_version.py +210 -0
- anyscale/client/openapi_client/models/readbillingversion_list_response.py +147 -0
- anyscale/client/openapi_client/models/replica_details.py +152 -0
- anyscale/client/openapi_client/models/replica_state.py +104 -0
- anyscale/client/openapi_client/models/request_email_magic_link_response.py +147 -0
- anyscale/client/openapi_client/models/request_otp_return_api_model.py +148 -0
- anyscale/client/openapi_client/models/request_password_reset_params.py +147 -0
- anyscale/client/openapi_client/models/requestemailmagiclinkresponse_response.py +121 -0
- anyscale/client/openapi_client/models/requestotpreturnapimodel_response.py +121 -0
- anyscale/client/openapi_client/models/reset_password_params.py +148 -0
- anyscale/client/openapi_client/models/resource_quota.py +465 -0
- anyscale/client/openapi_client/models/resource_quota_status.py +123 -0
- anyscale/client/openapi_client/models/resourcequota_list_response.py +147 -0
- anyscale/client/openapi_client/models/resourcequota_response.py +121 -0
- anyscale/client/openapi_client/models/resources.py +234 -0
- anyscale/client/openapi_client/models/resubmit_ft_job_request.py +121 -0
- anyscale/client/openapi_client/models/rollback_service_model.py +122 -0
- anyscale/client/openapi_client/models/rollout_strategy.py +100 -0
- anyscale/client/openapi_client/models/s3_download_location.py +148 -0
- anyscale/client/openapi_client/models/schedule_config.py +151 -0
- anyscale/client/openapi_client/models/serve_deployment_grafana_dashboard_status.py +101 -0
- anyscale/client/openapi_client/models/serve_deployment_logs.py +152 -0
- anyscale/client/openapi_client/models/serve_deployment_state.py +104 -0
- anyscale/client/openapi_client/models/servedeploymentlogs_response.py +121 -0
- anyscale/client/openapi_client/models/server_session_token.py +121 -0
- anyscale/client/openapi_client/models/serversessiontoken_response.py +121 -0
- anyscale/client/openapi_client/models/service_config.py +178 -0
- anyscale/client/openapi_client/models/service_event_current_state.py +108 -0
- anyscale/client/openapi_client/models/service_event_level.py +102 -0
- anyscale/client/openapi_client/models/service_event_origin.py +103 -0
- anyscale/client/openapi_client/models/service_event_scope.py +103 -0
- anyscale/client/openapi_client/models/service_event_scope_filter.py +104 -0
- anyscale/client/openapi_client/models/service_event_type.py +125 -0
- anyscale/client/openapi_client/models/service_event_verbose_message_model.py +180 -0
- anyscale/client/openapi_client/models/service_goal_states.py +100 -0
- anyscale/client/openapi_client/models/service_observability_urls.py +206 -0
- anyscale/client/openapi_client/models/service_sort_field.py +101 -0
- anyscale/client/openapi_client/models/service_type.py +100 -0
- anyscale/client/openapi_client/models/service_usage.py +353 -0
- anyscale/client/openapi_client/models/service_version_state.py +106 -0
- anyscale/client/openapi_client/models/serviceeventverbosemessagemodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/session.py +834 -0
- anyscale/client/openapi_client/models/session_access.py +102 -0
- anyscale/client/openapi_client/models/session_autosync_sessions_update_message.py +121 -0
- anyscale/client/openapi_client/models/session_command.py +413 -0
- anyscale/client/openapi_client/models/session_command_finish_options.py +226 -0
- anyscale/client/openapi_client/models/session_command_id.py +121 -0
- anyscale/client/openapi_client/models/session_command_types.py +100 -0
- anyscale/client/openapi_client/models/session_create_message.py +148 -0
- anyscale/client/openapi_client/models/session_delete_message.py +121 -0
- anyscale/client/openapi_client/models/session_describe.py +175 -0
- anyscale/client/openapi_client/models/session_details.py +148 -0
- anyscale/client/openapi_client/models/session_event.py +267 -0
- anyscale/client/openapi_client/models/session_event_cause.py +150 -0
- anyscale/client/openapi_client/models/session_event_types.py +111 -0
- anyscale/client/openapi_client/models/session_execute_message.py +121 -0
- anyscale/client/openapi_client/models/session_finish_command_message.py +175 -0
- anyscale/client/openapi_client/models/session_history_item.py +146 -0
- anyscale/client/openapi_client/models/session_kill_command_message.py +121 -0
- anyscale/client/openapi_client/models/session_list_response.py +147 -0
- anyscale/client/openapi_client/models/session_patch_message.py +121 -0
- anyscale/client/openapi_client/models/session_response.py +121 -0
- anyscale/client/openapi_client/models/session_ssh_key.py +148 -0
- anyscale/client/openapi_client/models/session_starting_up_data.py +146 -0
- anyscale/client/openapi_client/models/session_state.py +111 -0
- anyscale/client/openapi_client/models/session_state_change_message.py +121 -0
- anyscale/client/openapi_client/models/session_state_data.py +146 -0
- anyscale/client/openapi_client/models/session_stopping_data.py +146 -0
- anyscale/client/openapi_client/models/sessioncommand_list_response.py +147 -0
- anyscale/client/openapi_client/models/sessioncommandid_response.py +121 -0
- anyscale/client/openapi_client/models/sessiondescribe_response.py +121 -0
- anyscale/client/openapi_client/models/sessiondetails_response.py +121 -0
- anyscale/client/openapi_client/models/sessionevent_list_response.py +147 -0
- anyscale/client/openapi_client/models/sessionhistoryitem_list_response.py +147 -0
- anyscale/client/openapi_client/models/sessions_sort_field.py +104 -0
- anyscale/client/openapi_client/models/sessionsshkey_response.py +121 -0
- anyscale/client/openapi_client/models/setup_initialize_session_options.py +225 -0
- anyscale/client/openapi_client/models/show_otp_source_return_api_model.py +121 -0
- anyscale/client/openapi_client/models/showotpsourcereturnapimodel_response.py +121 -0
- anyscale/client/openapi_client/models/snapshot_create_message.py +148 -0
- anyscale/client/openapi_client/models/snapshot_delete_message.py +148 -0
- anyscale/client/openapi_client/models/snapshot_patch_message.py +148 -0
- anyscale/client/openapi_client/models/socket_message_schemas.py +499 -0
- anyscale/client/openapi_client/models/socket_message_types.py +113 -0
- anyscale/client/openapi_client/models/socketmessageschemas_response.py +121 -0
- anyscale/client/openapi_client/models/socketmessagetypes_response.py +121 -0
- anyscale/client/openapi_client/models/sort_order.py +100 -0
- anyscale/client/openapi_client/models/sso_login_info.py +151 -0
- anyscale/client/openapi_client/models/ssologininfo_response.py +121 -0
- anyscale/client/openapi_client/models/start_session_options.py +146 -0
- anyscale/client/openapi_client/models/stop_session_options.py +227 -0
- anyscale/client/openapi_client/models/stream_publish_request.py +239 -0
- anyscale/client/openapi_client/models/subnet_id_with_availability_zone_aws.py +148 -0
- anyscale/client/openapi_client/models/support_requests_query.py +178 -0
- anyscale/client/openapi_client/models/supportedbaseimagesenum.py +1570 -0
- anyscale/client/openapi_client/models/templatized_compute_configs.py +202 -0
- anyscale/client/openapi_client/models/templatized_decorated_application_templates.py +202 -0
- anyscale/client/openapi_client/models/templatizedcomputeconfigs_response.py +121 -0
- anyscale/client/openapi_client/models/templatizeddecoratedapplicationtemplates_response.py +121 -0
- anyscale/client/openapi_client/models/text_query.py +178 -0
- anyscale/client/openapi_client/models/timestamped_logs_output.py +148 -0
- anyscale/client/openapi_client/models/timestampedlogsoutput_response.py +121 -0
- anyscale/client/openapi_client/models/tool.py +100 -0
- anyscale/client/openapi_client/models/tracing_config.py +178 -0
- anyscale/client/openapi_client/models/try_login_email_response.py +208 -0
- anyscale/client/openapi_client/models/tryloginemailresponse_response.py +121 -0
- anyscale/client/openapi_client/models/unified_job_sort_field.py +103 -0
- anyscale/client/openapi_client/models/unified_job_status.py +114 -0
- anyscale/client/openapi_client/models/unified_job_type.py +100 -0
- anyscale/client/openapi_client/models/update_cloud_with_cloud_resource.py +178 -0
- anyscale/client/openapi_client/models/update_cloud_with_cloud_resource_gcp.py +178 -0
- anyscale/client/openapi_client/models/update_cluster_dns.py +152 -0
- anyscale/client/openapi_client/models/update_compute_template.py +146 -0
- anyscale/client/openapi_client/models/update_compute_template_config.py +464 -0
- anyscale/client/openapi_client/models/update_endpoint.py +152 -0
- anyscale/client/openapi_client/models/update_machine_pool_request.py +151 -0
- anyscale/client/openapi_client/models/update_model_deployment.py +152 -0
- anyscale/client/openapi_client/models/update_organization_collaborator.py +121 -0
- anyscale/client/openapi_client/models/update_project_collaborator.py +121 -0
- anyscale/client/openapi_client/models/update_resource_quota.py +122 -0
- anyscale/client/openapi_client/models/updatemachinepoolresponse_response.py +121 -0
- anyscale/client/openapi_client/models/upload_session_command_logs_locations.py +148 -0
- anyscale/client/openapi_client/models/uploadsessioncommandlogslocations_response.py +121 -0
- anyscale/client/openapi_client/models/user_info.py +569 -0
- anyscale/client/openapi_client/models/user_resend_email_options.py +147 -0
- anyscale/client/openapi_client/models/user_service_access_types.py +100 -0
- anyscale/client/openapi_client/models/userinfo_response.py +121 -0
- anyscale/client/openapi_client/models/utm_fields.py +224 -0
- anyscale/client/openapi_client/models/ux_instance.py +468 -0
- anyscale/client/openapi_client/models/validate_otp_params_api_model.py +121 -0
- anyscale/client/openapi_client/models/validation_error.py +175 -0
- anyscale/client/openapi_client/models/verify_response.py +147 -0
- anyscale/client/openapi_client/models/verifyresponse_response.py +121 -0
- anyscale/client/openapi_client/models/visibility.py +100 -0
- anyscale/client/openapi_client/models/waitlist_status_response.py +121 -0
- anyscale/client/openapi_client/models/waitlist_status_type.py +100 -0
- anyscale/client/openapi_client/models/waitliststatusresponse_response.py +121 -0
- anyscale/client/openapi_client/models/wand_b_run_details.py +147 -0
- anyscale/client/openapi_client/models/web_terminal.py +121 -0
- anyscale/client/openapi_client/models/webterminal_list_response.py +147 -0
- anyscale/client/openapi_client/models/webterminal_response.py +121 -0
- anyscale/client/openapi_client/models/worker_node_type.py +404 -0
- anyscale/client/openapi_client/models/workload_type.py +102 -0
- anyscale/client/openapi_client/models/workspace_dataplane_artifact.py +181 -0
- anyscale/client/openapi_client/models/workspace_dataplane_artifacts.py +123 -0
- anyscale/client/openapi_client/models/workspace_dataplane_proxied_artifacts.py +178 -0
- anyscale/client/openapi_client/models/workspace_event.py +325 -0
- anyscale/client/openapi_client/models/workspace_event_source.py +100 -0
- anyscale/client/openapi_client/models/workspace_event_source_filter.py +101 -0
- anyscale/client/openapi_client/models/workspace_readme.py +123 -0
- anyscale/client/openapi_client/models/workspace_snapshot_states.py +108 -0
- anyscale/client/openapi_client/models/workspace_template.py +353 -0
- anyscale/client/openapi_client/models/workspace_template_cluster_environment_metadata.py +178 -0
- anyscale/client/openapi_client/models/workspacedataplaneartifacts_response.py +121 -0
- anyscale/client/openapi_client/models/workspacedataplaneproxiedartifacts_response.py +121 -0
- anyscale/client/openapi_client/models/workspaceevent_list_response.py +147 -0
- anyscale/client/openapi_client/models/workspacereadme_response.py +121 -0
- anyscale/client/openapi_client/models/workspacetemplate_list_response.py +147 -0
- anyscale/client/openapi_client/models/workspacetemplateclusterenvironmentmetadata_response.py +121 -0
- anyscale/client/openapi_client/models/write_cloud.py +546 -0
- anyscale/client/openapi_client/models/write_cluster_config.py +123 -0
- anyscale/client/openapi_client/models/write_project.py +226 -0
- anyscale/client/openapi_client/models/write_session.py +147 -0
- anyscale/client/openapi_client/models/write_support_request.py +121 -0
- anyscale/client/openapi_client/rest.py +296 -0
- anyscale/client/requirements.txt +6 -0
- anyscale/client/setup.cfg +2 -0
- anyscale/client/setup.py +40 -0
- anyscale/client/test-requirements.txt +3 -0
- anyscale/client/tox.ini +9 -0
- anyscale/cloud.py +216 -0
- anyscale/cloud_resource.py +1032 -0
- anyscale/cluster.py +138 -0
- anyscale/cluster_compute.py +167 -0
- anyscale/cluster_env.py +173 -0
- anyscale/commands/__init__.py +0 -0
- anyscale/commands/aggregated_instance_usage_commands.py +86 -0
- anyscale/commands/anyscale_api/__init__.py +0 -0
- anyscale/commands/anyscale_api/api_commands.py +23 -0
- anyscale/commands/anyscale_api/session_commands_commands.py +80 -0
- anyscale/commands/anyscale_api/session_operations_commands.py +28 -0
- anyscale/commands/anyscale_api/sessions_commands.py +152 -0
- anyscale/commands/auth_commands.py +41 -0
- anyscale/commands/cloud_commands.py +1011 -0
- anyscale/commands/cloud_commands_util.py +10 -0
- anyscale/commands/cluster_commands.py +476 -0
- anyscale/commands/cluster_env_commands.py +139 -0
- anyscale/commands/command_examples.py +495 -0
- anyscale/commands/compute_config_commands.py +252 -0
- anyscale/commands/config_commands.py +213 -0
- anyscale/commands/exec_commands.py +14 -0
- anyscale/commands/experimental_integrations_commands.py +70 -0
- anyscale/commands/image_commands.py +125 -0
- anyscale/commands/job_commands.py +745 -0
- anyscale/commands/list_commands.py +85 -0
- anyscale/commands/llm/dataset_commands.py +269 -0
- anyscale/commands/llm/group.py +15 -0
- anyscale/commands/llm/models_commands.py +123 -0
- anyscale/commands/login_commands.py +79 -0
- anyscale/commands/logs_commands.py +312 -0
- anyscale/commands/machine_commands.py +116 -0
- anyscale/commands/machine_pool_commands.py +163 -0
- anyscale/commands/migrate_commands.py +84 -0
- anyscale/commands/project_commands.py +203 -0
- anyscale/commands/resource_quota_commands.py +214 -0
- anyscale/commands/schedule_commands.py +436 -0
- anyscale/commands/service_account_commands.py +72 -0
- anyscale/commands/service_commands.py +738 -0
- anyscale/commands/session_commands_hidden.py +179 -0
- anyscale/commands/util.py +152 -0
- anyscale/commands/workspace_commands.py +511 -0
- anyscale/commands/workspace_commands_v2.py +874 -0
- anyscale/component_activity_util.py +83 -0
- anyscale/compute_config/__init__.py +84 -0
- anyscale/compute_config/_private/compute_config_sdk.py +433 -0
- anyscale/compute_config/commands.py +122 -0
- anyscale/compute_config/models.py +630 -0
- anyscale/conf.py +23 -0
- anyscale/connect.py +1323 -0
- anyscale/connect_utils/__init__.py +0 -0
- anyscale/connect_utils/prepare_cluster.py +962 -0
- anyscale/connect_utils/project.py +298 -0
- anyscale/connect_utils/start_interactive_session.py +437 -0
- anyscale/controllers/__init__.py +0 -0
- anyscale/controllers/auth_controller.py +134 -0
- anyscale/controllers/base_controller.py +52 -0
- anyscale/controllers/cloud_controller.py +3609 -0
- anyscale/controllers/cloud_functional_verification_controller.py +858 -0
- anyscale/controllers/cluster_controller.py +720 -0
- anyscale/controllers/cluster_env_controller.py +219 -0
- anyscale/controllers/compute_config_controller.py +351 -0
- anyscale/controllers/config_controller.py +422 -0
- anyscale/controllers/experimental_integrations_controller.py +80 -0
- anyscale/controllers/job_controller.py +647 -0
- anyscale/controllers/jobs_bg_controller.py +0 -0
- anyscale/controllers/list_controller.py +290 -0
- anyscale/controllers/llm/__init__.py +0 -0
- anyscale/controllers/llm/models_controller.py +144 -0
- anyscale/controllers/logs_controller.py +449 -0
- anyscale/controllers/machine_controller.py +37 -0
- anyscale/controllers/machine_pool_controller.py +86 -0
- anyscale/controllers/project_controller.py +281 -0
- anyscale/controllers/resource_quota_controller.py +183 -0
- anyscale/controllers/schedule_controller.py +333 -0
- anyscale/controllers/service_account_controller.py +168 -0
- anyscale/controllers/service_controller.py +453 -0
- anyscale/controllers/workspace_controller.py +253 -0
- anyscale/feature_flags.py +4 -0
- anyscale/fingerprint.py +62 -0
- anyscale/formatters/__init__.py +0 -0
- anyscale/formatters/clouds_formatter.py +65 -0
- anyscale/formatters/common_formatter.py +22 -0
- anyscale/gcp_verification.py +792 -0
- anyscale/image/__init__.py +73 -0
- anyscale/image/_private/image_sdk.py +202 -0
- anyscale/image/commands.py +117 -0
- anyscale/image/models.py +57 -0
- anyscale/integrations.py +329 -0
- anyscale/job/__init__.py +166 -0
- anyscale/job/_private/job_sdk.py +497 -0
- anyscale/job/commands.py +267 -0
- anyscale/job/models.py +500 -0
- anyscale/links.py +4 -0
- anyscale/llm/__init__.py +2 -0
- anyscale/llm/dataset/__init__.py +2 -0
- anyscale/llm/dataset/_private/__init__.py +0 -0
- anyscale/llm/dataset/_private/docs.py +63 -0
- anyscale/llm/dataset/_private/models.py +71 -0
- anyscale/llm/dataset/_private/sdk.py +147 -0
- anyscale/llm/model/__init__.py +2 -0
- anyscale/llm/model/_private/models_sdk.py +62 -0
- anyscale/llm/model/commands.py +93 -0
- anyscale/llm/model/models.py +171 -0
- anyscale/llm/model/sdk.py +62 -0
- anyscale/llm/sdk.py +27 -0
- anyscale/memorydb_supported_zones.json +22 -0
- anyscale/models/job_model.py +457 -0
- anyscale/models/service_model.py +125 -0
- anyscale/project.py +501 -0
- anyscale/schedule/__init__.py +91 -0
- anyscale/schedule/_private/schedule_sdk.py +165 -0
- anyscale/schedule/commands.py +149 -0
- anyscale/schedule/models.py +145 -0
- anyscale/scripts.py +164 -0
- anyscale/sdk/anyscale_client/__init__.py +235 -0
- anyscale/sdk/anyscale_client/api/__init__.py +6 -0
- anyscale/sdk/anyscale_client/api/default_api.py +11625 -0
- anyscale/sdk/anyscale_client/api_client.py +647 -0
- anyscale/sdk/anyscale_client/configuration.py +373 -0
- anyscale/sdk/anyscale_client/exceptions.py +120 -0
- anyscale/sdk/anyscale_client/models/__init__.py +220 -0
- anyscale/sdk/anyscale_client/models/access_config.py +122 -0
- anyscale/sdk/anyscale_client/models/app_config.py +436 -0
- anyscale/sdk/anyscale_client/models/app_config_config_schema.py +235 -0
- anyscale/sdk/anyscale_client/models/appconfig_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/appconfig_response.py +121 -0
- anyscale/sdk/anyscale_client/models/apply_production_service_v2_model.py +490 -0
- anyscale/sdk/anyscale_client/models/apply_service_model.py +490 -0
- anyscale/sdk/anyscale_client/models/archive_status.py +101 -0
- anyscale/sdk/anyscale_client/models/base_job_status.py +105 -0
- anyscale/sdk/anyscale_client/models/baseimagesenum.py +2130 -0
- anyscale/sdk/anyscale_client/models/build.py +607 -0
- anyscale/sdk/anyscale_client/models/build_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/build_log_response.py +123 -0
- anyscale/sdk/anyscale_client/models/build_response.py +121 -0
- anyscale/sdk/anyscale_client/models/build_status.py +104 -0
- anyscale/sdk/anyscale_client/models/buildlogresponse_response.py +121 -0
- anyscale/sdk/anyscale_client/models/cloud.py +802 -0
- anyscale/sdk/anyscale_client/models/cloud_config.py +206 -0
- anyscale/sdk/anyscale_client/models/cloud_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/cloud_providers.py +103 -0
- anyscale/sdk/anyscale_client/models/cloud_response.py +121 -0
- anyscale/sdk/anyscale_client/models/cloud_state.py +104 -0
- anyscale/sdk/anyscale_client/models/cloud_status.py +100 -0
- anyscale/sdk/anyscale_client/models/cloud_type.py +100 -0
- anyscale/sdk/anyscale_client/models/cloud_types.py +100 -0
- anyscale/sdk/anyscale_client/models/cloud_version.py +100 -0
- anyscale/sdk/anyscale_client/models/clouds_query.py +150 -0
- anyscale/sdk/anyscale_client/models/cluster.py +721 -0
- anyscale/sdk/anyscale_client/models/cluster_compute.py +415 -0
- anyscale/sdk/anyscale_client/models/cluster_compute_config.py +461 -0
- anyscale/sdk/anyscale_client/models/cluster_computes_query.py +293 -0
- anyscale/sdk/anyscale_client/models/cluster_environment.py +380 -0
- anyscale/sdk/anyscale_client/models/cluster_environment_build.py +578 -0
- anyscale/sdk/anyscale_client/models/cluster_environment_build_log_response.py +123 -0
- anyscale/sdk/anyscale_client/models/cluster_environment_build_operation.py +237 -0
- anyscale/sdk/anyscale_client/models/cluster_environment_build_status.py +104 -0
- anyscale/sdk/anyscale_client/models/cluster_environments_query.py +290 -0
- anyscale/sdk/anyscale_client/models/cluster_head_node_info.py +152 -0
- anyscale/sdk/anyscale_client/models/cluster_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/cluster_management_stack_versions.py +100 -0
- anyscale/sdk/anyscale_client/models/cluster_operation.py +266 -0
- anyscale/sdk/anyscale_client/models/cluster_operation_type.py +101 -0
- anyscale/sdk/anyscale_client/models/cluster_response.py +121 -0
- anyscale/sdk/anyscale_client/models/cluster_services_urls.py +430 -0
- anyscale/sdk/anyscale_client/models/cluster_state.py +108 -0
- anyscale/sdk/anyscale_client/models/cluster_status.py +104 -0
- anyscale/sdk/anyscale_client/models/cluster_status_details.py +100 -0
- anyscale/sdk/anyscale_client/models/clustercompute_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/clustercompute_response.py +121 -0
- anyscale/sdk/anyscale_client/models/clusterenvironment_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/clusterenvironment_response.py +121 -0
- anyscale/sdk/anyscale_client/models/clusterenvironmentbuild_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/clusterenvironmentbuild_response.py +121 -0
- anyscale/sdk/anyscale_client/models/clusterenvironmentbuildlogresponse_response.py +121 -0
- anyscale/sdk/anyscale_client/models/clusterenvironmentbuildoperation_response.py +121 -0
- anyscale/sdk/anyscale_client/models/clusteroperation_response.py +121 -0
- anyscale/sdk/anyscale_client/models/clusters_query.py +234 -0
- anyscale/sdk/anyscale_client/models/compute_node_type.py +292 -0
- anyscale/sdk/anyscale_client/models/compute_stack.py +100 -0
- anyscale/sdk/anyscale_client/models/compute_template.py +415 -0
- anyscale/sdk/anyscale_client/models/compute_template_config.py +461 -0
- anyscale/sdk/anyscale_client/models/compute_template_query.py +316 -0
- anyscale/sdk/anyscale_client/models/computetemplate_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/computetemplate_response.py +121 -0
- anyscale/sdk/anyscale_client/models/computetemplateconfig_response.py +121 -0
- anyscale/sdk/anyscale_client/models/create_app_config.py +235 -0
- anyscale/sdk/anyscale_client/models/create_app_config_configuration_schema.py +235 -0
- anyscale/sdk/anyscale_client/models/create_build.py +263 -0
- anyscale/sdk/anyscale_client/models/create_byod_app_config_configuration_schema.py +206 -0
- anyscale/sdk/anyscale_client/models/create_byod_cluster_environment.py +180 -0
- anyscale/sdk/anyscale_client/models/create_byod_cluster_environment_build.py +152 -0
- anyscale/sdk/anyscale_client/models/create_byod_cluster_environment_configuration_schema.py +208 -0
- anyscale/sdk/anyscale_client/models/create_cloud.py +518 -0
- anyscale/sdk/anyscale_client/models/create_cluster.py +376 -0
- anyscale/sdk/anyscale_client/models/create_cluster_compute.py +229 -0
- anyscale/sdk/anyscale_client/models/create_cluster_compute_config.py +463 -0
- anyscale/sdk/anyscale_client/models/create_cluster_environment.py +235 -0
- anyscale/sdk/anyscale_client/models/create_cluster_environment_build.py +263 -0
- anyscale/sdk/anyscale_client/models/create_cluster_environment_configuration_schema.py +235 -0
- anyscale/sdk/anyscale_client/models/create_compute_template.py +229 -0
- anyscale/sdk/anyscale_client/models/create_compute_template_config.py +464 -0
- anyscale/sdk/anyscale_client/models/create_job_queue_config.py +206 -0
- anyscale/sdk/anyscale_client/models/create_production_job.py +234 -0
- anyscale/sdk/anyscale_client/models/create_production_job_config.py +347 -0
- anyscale/sdk/anyscale_client/models/create_project.py +207 -0
- anyscale/sdk/anyscale_client/models/create_schedule.py +263 -0
- anyscale/sdk/anyscale_client/models/create_session.py +432 -0
- anyscale/sdk/anyscale_client/models/create_session_command.py +152 -0
- anyscale/sdk/anyscale_client/models/create_sso_config.py +150 -0
- anyscale/sdk/anyscale_client/models/grpc_protocol_config.py +178 -0
- anyscale/sdk/anyscale_client/models/ha_job_goal_states.py +102 -0
- anyscale/sdk/anyscale_client/models/ha_job_states.py +109 -0
- anyscale/sdk/anyscale_client/models/http_protocol_config.py +150 -0
- anyscale/sdk/anyscale_client/models/http_validation_error.py +120 -0
- anyscale/sdk/anyscale_client/models/idle_termination_status.py +104 -0
- anyscale/sdk/anyscale_client/models/job.py +466 -0
- anyscale/sdk/anyscale_client/models/job_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/job_queue_config.py +122 -0
- anyscale/sdk/anyscale_client/models/job_queue_execution_mode.py +101 -0
- anyscale/sdk/anyscale_client/models/job_queue_spec.py +263 -0
- anyscale/sdk/anyscale_client/models/job_run_type.py +101 -0
- anyscale/sdk/anyscale_client/models/job_status.py +105 -0
- anyscale/sdk/anyscale_client/models/jobs_query.py +458 -0
- anyscale/sdk/anyscale_client/models/jobs_sort_field.py +104 -0
- anyscale/sdk/anyscale_client/models/list_response_metadata.py +146 -0
- anyscale/sdk/anyscale_client/models/list_service_model.py +347 -0
- anyscale/sdk/anyscale_client/models/listservicemodel_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/log_download_result.py +207 -0
- anyscale/sdk/anyscale_client/models/log_file_chunk.py +439 -0
- anyscale/sdk/anyscale_client/models/log_level_types.py +100 -0
- anyscale/sdk/anyscale_client/models/log_stream.py +151 -0
- anyscale/sdk/anyscale_client/models/logdownloadresult_response.py +121 -0
- anyscale/sdk/anyscale_client/models/logstream_response.py +121 -0
- anyscale/sdk/anyscale_client/models/node_type.py +100 -0
- anyscale/sdk/anyscale_client/models/object_storage_config.py +122 -0
- anyscale/sdk/anyscale_client/models/object_storage_config_s3.py +256 -0
- anyscale/sdk/anyscale_client/models/objectstorageconfig_response.py +121 -0
- anyscale/sdk/anyscale_client/models/operation_error.py +123 -0
- anyscale/sdk/anyscale_client/models/operation_progress.py +123 -0
- anyscale/sdk/anyscale_client/models/operation_result.py +150 -0
- anyscale/sdk/anyscale_client/models/organization.py +209 -0
- anyscale/sdk/anyscale_client/models/organization_response.py +121 -0
- anyscale/sdk/anyscale_client/models/page_query.py +153 -0
- anyscale/sdk/anyscale_client/models/pause_schedule.py +123 -0
- anyscale/sdk/anyscale_client/models/production_job.py +437 -0
- anyscale/sdk/anyscale_client/models/production_job_config.py +348 -0
- anyscale/sdk/anyscale_client/models/production_job_state_transition.py +293 -0
- anyscale/sdk/anyscale_client/models/production_service_v2_model.py +612 -0
- anyscale/sdk/anyscale_client/models/production_service_v2_version_model.py +437 -0
- anyscale/sdk/anyscale_client/models/productionjob_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/productionjob_response.py +121 -0
- anyscale/sdk/anyscale_client/models/productionservicev2_model_response.py +121 -0
- anyscale/sdk/anyscale_client/models/project.py +467 -0
- anyscale/sdk/anyscale_client/models/project_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/project_response.py +121 -0
- anyscale/sdk/anyscale_client/models/projects_query.py +234 -0
- anyscale/sdk/anyscale_client/models/protocols.py +150 -0
- anyscale/sdk/anyscale_client/models/python_modules.py +150 -0
- anyscale/sdk/anyscale_client/models/python_version.py +105 -0
- anyscale/sdk/anyscale_client/models/ray_gcs_external_storage_config.py +178 -0
- anyscale/sdk/anyscale_client/models/ray_runtime_env_config.py +262 -0
- anyscale/sdk/anyscale_client/models/resources.py +234 -0
- anyscale/sdk/anyscale_client/models/rollback_service_model.py +122 -0
- anyscale/sdk/anyscale_client/models/rollout_strategy.py +100 -0
- anyscale/sdk/anyscale_client/models/runtime_environment.py +406 -0
- anyscale/sdk/anyscale_client/models/runtimeenvironment_response.py +121 -0
- anyscale/sdk/anyscale_client/models/schedule_api_model.py +467 -0
- anyscale/sdk/anyscale_client/models/schedule_config.py +151 -0
- anyscale/sdk/anyscale_client/models/scheduleapimodel_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/scheduleapimodel_response.py +121 -0
- anyscale/sdk/anyscale_client/models/service_config.py +178 -0
- anyscale/sdk/anyscale_client/models/service_event_current_state.py +108 -0
- anyscale/sdk/anyscale_client/models/service_goal_states.py +100 -0
- anyscale/sdk/anyscale_client/models/service_model.py +612 -0
- anyscale/sdk/anyscale_client/models/service_observability_urls.py +206 -0
- anyscale/sdk/anyscale_client/models/service_sort_field.py +101 -0
- anyscale/sdk/anyscale_client/models/service_type.py +100 -0
- anyscale/sdk/anyscale_client/models/service_version_state.py +106 -0
- anyscale/sdk/anyscale_client/models/servicemodel_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/servicemodel_response.py +121 -0
- anyscale/sdk/anyscale_client/models/session.py +1535 -0
- anyscale/sdk/anyscale_client/models/session_command.py +350 -0
- anyscale/sdk/anyscale_client/models/session_command_types.py +100 -0
- anyscale/sdk/anyscale_client/models/session_event.py +267 -0
- anyscale/sdk/anyscale_client/models/session_event_cause.py +150 -0
- anyscale/sdk/anyscale_client/models/session_event_types.py +111 -0
- anyscale/sdk/anyscale_client/models/session_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/session_operation.py +266 -0
- anyscale/sdk/anyscale_client/models/session_operation_type.py +101 -0
- anyscale/sdk/anyscale_client/models/session_response.py +121 -0
- anyscale/sdk/anyscale_client/models/session_starting_up_data.py +146 -0
- anyscale/sdk/anyscale_client/models/session_state.py +111 -0
- anyscale/sdk/anyscale_client/models/session_state_data.py +146 -0
- anyscale/sdk/anyscale_client/models/session_stopping_data.py +146 -0
- anyscale/sdk/anyscale_client/models/sessioncommand_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/sessioncommand_response.py +121 -0
- anyscale/sdk/anyscale_client/models/sessionevent_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/sessionoperation_response.py +121 -0
- anyscale/sdk/anyscale_client/models/sessions_query.py +206 -0
- anyscale/sdk/anyscale_client/models/sort_by_clause_jobs_sort_field.py +148 -0
- anyscale/sdk/anyscale_client/models/sort_order.py +100 -0
- anyscale/sdk/anyscale_client/models/sso_config.py +237 -0
- anyscale/sdk/anyscale_client/models/sso_mode.py +101 -0
- anyscale/sdk/anyscale_client/models/ssoconfig_response.py +121 -0
- anyscale/sdk/anyscale_client/models/start_cluster_options.py +178 -0
- anyscale/sdk/anyscale_client/models/start_session_options.py +206 -0
- anyscale/sdk/anyscale_client/models/static_sso_config.py +210 -0
- anyscale/sdk/anyscale_client/models/supportedbaseimagesenum.py +1570 -0
- anyscale/sdk/anyscale_client/models/terminate_cluster_options.py +122 -0
- anyscale/sdk/anyscale_client/models/terminate_session_options.py +206 -0
- anyscale/sdk/anyscale_client/models/text_query.py +178 -0
- anyscale/sdk/anyscale_client/models/tracing_config.py +178 -0
- anyscale/sdk/anyscale_client/models/update_app_config.py +122 -0
- anyscale/sdk/anyscale_client/models/update_cloud.py +150 -0
- anyscale/sdk/anyscale_client/models/update_cluster.py +206 -0
- anyscale/sdk/anyscale_client/models/update_compute_template.py +146 -0
- anyscale/sdk/anyscale_client/models/update_compute_template_config.py +464 -0
- anyscale/sdk/anyscale_client/models/update_organization.py +123 -0
- anyscale/sdk/anyscale_client/models/update_project.py +150 -0
- anyscale/sdk/anyscale_client/models/update_session.py +150 -0
- anyscale/sdk/anyscale_client/models/user_service_access_types.py +100 -0
- anyscale/sdk/anyscale_client/models/ux_instance.py +468 -0
- anyscale/sdk/anyscale_client/models/validation_error.py +175 -0
- anyscale/sdk/anyscale_client/models/worker_node_type.py +404 -0
- anyscale/sdk/anyscale_client/rest.py +296 -0
- anyscale/sdk/anyscale_client/sdk.py +634 -0
- anyscale/service/__init__.py +168 -0
- anyscale/service/_private/service_sdk.py +702 -0
- anyscale/service/commands.py +261 -0
- anyscale/service/models.py +671 -0
- anyscale/shared_anyscale_utils/__init__.py +1 -0
- anyscale/shared_anyscale_utils/aws.py +153 -0
- anyscale/shared_anyscale_utils/bytes_util.py +10 -0
- anyscale/shared_anyscale_utils/conf.py +47 -0
- anyscale/shared_anyscale_utils/default_anyscale_aws.yaml +74 -0
- anyscale/shared_anyscale_utils/default_anyscale_gcp.yaml +80 -0
- anyscale/shared_anyscale_utils/headers.py +38 -0
- anyscale/shared_anyscale_utils/latest_ray_version.py +2 -0
- anyscale/shared_anyscale_utils/project.py +15 -0
- anyscale/shared_anyscale_utils/test_util.py +22 -0
- anyscale/shared_anyscale_utils/tests/__init__.py +1 -0
- anyscale/shared_anyscale_utils/tests/test_asyncio.py +41 -0
- anyscale/shared_anyscale_utils/tests/test_ray_semver.py +63 -0
- anyscale/shared_anyscale_utils/util.py +50 -0
- anyscale/shared_anyscale_utils/utils/__init__.py +2 -0
- anyscale/shared_anyscale_utils/utils/asyncio.py +120 -0
- anyscale/shared_anyscale_utils/utils/byod.py +40 -0
- anyscale/shared_anyscale_utils/utils/collections.py +33 -0
- anyscale/shared_anyscale_utils/utils/id_gen.py +147 -0
- anyscale/shared_anyscale_utils/utils/protected_string.py +89 -0
- anyscale/shared_anyscale_utils/utils/ray_semver.py +81 -0
- anyscale/snapshot.py +46 -0
- anyscale/tables.py +82 -0
- anyscale/util.py +1155 -0
- anyscale/utils/__init__.py +0 -0
- anyscale/utils/cli_version_check_util.py +63 -0
- anyscale/utils/cloud_update_utils.py +862 -0
- anyscale/utils/cloud_utils.py +317 -0
- anyscale/utils/cluster_debug.py +191 -0
- anyscale/utils/connect_helpers.py +155 -0
- anyscale/utils/deprecation_util.py +32 -0
- anyscale/utils/entity_arg_utils.py +43 -0
- anyscale/utils/env_utils.py +17 -0
- anyscale/utils/gcp_managed_setup_utils.py +888 -0
- anyscale/utils/gcp_utils.py +312 -0
- anyscale/utils/imports/__init__.py +0 -0
- anyscale/utils/imports/all.py +13 -0
- anyscale/utils/imports/azure.py +14 -0
- anyscale/utils/imports/gcp.py +59 -0
- anyscale/utils/logs_utils.py +141 -0
- anyscale/utils/name_utils.py +33 -0
- anyscale/utils/network_verification.py +153 -0
- anyscale/utils/ray_utils.py +128 -0
- anyscale/utils/ray_version_checker.py +48 -0
- anyscale/utils/ray_version_utils.py +53 -0
- anyscale/utils/runtime_env.py +487 -0
- anyscale/utils/s3.py +92 -0
- anyscale/utils/user_utils.py +17 -0
- anyscale/utils/workload_types.py +7 -0
- anyscale/utils/workspace_notification.py +39 -0
- anyscale/utils/workspace_utils.py +65 -0
- anyscale/version.py +1 -0
- anyscale/webterminal/__init__.py +0 -0
- anyscale/webterminal/bash-preexec.sh +370 -0
- anyscale/webterminal/command_persister.py +164 -0
- anyscale/webterminal/utils.py +176 -0
- anyscale/webterminal/webterminal.py +311 -0
- anyscale/workspace/__init__.py +270 -0
- anyscale/workspace/_private/workspace_sdk.py +737 -0
- anyscale/workspace/commands.py +472 -0
- anyscale/workspace/models.py +296 -0
- anyscale/workspace_utils.py +35 -0
- anyscale-0.24.86.dist-info/LICENSE +68 -0
- anyscale-0.24.86.dist-info/METADATA +82 -0
- anyscale-0.24.86.dist-info/NOTICE +6 -0
- anyscale-0.24.86.dist-info/RECORD +1131 -0
- anyscale-0.24.86.dist-info/WHEEL +5 -0
- anyscale-0.24.86.dist-info/entry_points.txt +2 -0
- anyscale-0.24.86.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1206 @@
|
|
|
1
|
+
import abc
|
|
2
|
+
import math
|
|
3
|
+
import re
|
|
4
|
+
import warnings
|
|
5
|
+
from datetime import date
|
|
6
|
+
from decimal import Decimal, InvalidOperation
|
|
7
|
+
from enum import Enum
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from types import new_class
|
|
10
|
+
from typing import (
|
|
11
|
+
TYPE_CHECKING,
|
|
12
|
+
Any,
|
|
13
|
+
Callable,
|
|
14
|
+
ClassVar,
|
|
15
|
+
Dict,
|
|
16
|
+
FrozenSet,
|
|
17
|
+
List,
|
|
18
|
+
Optional,
|
|
19
|
+
Pattern,
|
|
20
|
+
Set,
|
|
21
|
+
Tuple,
|
|
22
|
+
Type,
|
|
23
|
+
TypeVar,
|
|
24
|
+
Union,
|
|
25
|
+
cast,
|
|
26
|
+
overload,
|
|
27
|
+
)
|
|
28
|
+
from uuid import UUID
|
|
29
|
+
from weakref import WeakSet
|
|
30
|
+
|
|
31
|
+
from . import errors
|
|
32
|
+
from .datetime_parse import parse_date
|
|
33
|
+
from .utils import import_string, update_not_none
|
|
34
|
+
from .validators import (
|
|
35
|
+
bytes_validator,
|
|
36
|
+
constr_length_validator,
|
|
37
|
+
constr_lower,
|
|
38
|
+
constr_strip_whitespace,
|
|
39
|
+
constr_upper,
|
|
40
|
+
decimal_validator,
|
|
41
|
+
float_finite_validator,
|
|
42
|
+
float_validator,
|
|
43
|
+
frozenset_validator,
|
|
44
|
+
int_validator,
|
|
45
|
+
list_validator,
|
|
46
|
+
number_multiple_validator,
|
|
47
|
+
number_size_validator,
|
|
48
|
+
path_exists_validator,
|
|
49
|
+
path_validator,
|
|
50
|
+
set_validator,
|
|
51
|
+
str_validator,
|
|
52
|
+
strict_bytes_validator,
|
|
53
|
+
strict_float_validator,
|
|
54
|
+
strict_int_validator,
|
|
55
|
+
strict_str_validator,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
__all__ = [
|
|
59
|
+
'NoneStr',
|
|
60
|
+
'NoneBytes',
|
|
61
|
+
'StrBytes',
|
|
62
|
+
'NoneStrBytes',
|
|
63
|
+
'StrictStr',
|
|
64
|
+
'ConstrainedBytes',
|
|
65
|
+
'conbytes',
|
|
66
|
+
'ConstrainedList',
|
|
67
|
+
'conlist',
|
|
68
|
+
'ConstrainedSet',
|
|
69
|
+
'conset',
|
|
70
|
+
'ConstrainedFrozenSet',
|
|
71
|
+
'confrozenset',
|
|
72
|
+
'ConstrainedStr',
|
|
73
|
+
'constr',
|
|
74
|
+
'PyObject',
|
|
75
|
+
'ConstrainedInt',
|
|
76
|
+
'conint',
|
|
77
|
+
'PositiveInt',
|
|
78
|
+
'NegativeInt',
|
|
79
|
+
'NonNegativeInt',
|
|
80
|
+
'NonPositiveInt',
|
|
81
|
+
'ConstrainedFloat',
|
|
82
|
+
'confloat',
|
|
83
|
+
'PositiveFloat',
|
|
84
|
+
'NegativeFloat',
|
|
85
|
+
'NonNegativeFloat',
|
|
86
|
+
'NonPositiveFloat',
|
|
87
|
+
'FiniteFloat',
|
|
88
|
+
'ConstrainedDecimal',
|
|
89
|
+
'condecimal',
|
|
90
|
+
'UUID1',
|
|
91
|
+
'UUID3',
|
|
92
|
+
'UUID4',
|
|
93
|
+
'UUID5',
|
|
94
|
+
'FilePath',
|
|
95
|
+
'DirectoryPath',
|
|
96
|
+
'Json',
|
|
97
|
+
'JsonWrapper',
|
|
98
|
+
'SecretField',
|
|
99
|
+
'SecretStr',
|
|
100
|
+
'SecretBytes',
|
|
101
|
+
'StrictBool',
|
|
102
|
+
'StrictBytes',
|
|
103
|
+
'StrictInt',
|
|
104
|
+
'StrictFloat',
|
|
105
|
+
'PaymentCardNumber',
|
|
106
|
+
'ByteSize',
|
|
107
|
+
'PastDate',
|
|
108
|
+
'FutureDate',
|
|
109
|
+
'ConstrainedDate',
|
|
110
|
+
'condate',
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
NoneStr = Optional[str]
|
|
114
|
+
NoneBytes = Optional[bytes]
|
|
115
|
+
StrBytes = Union[str, bytes]
|
|
116
|
+
NoneStrBytes = Optional[StrBytes]
|
|
117
|
+
OptionalInt = Optional[int]
|
|
118
|
+
OptionalIntFloat = Union[OptionalInt, float]
|
|
119
|
+
OptionalIntFloatDecimal = Union[OptionalIntFloat, Decimal]
|
|
120
|
+
OptionalDate = Optional[date]
|
|
121
|
+
StrIntFloat = Union[str, int, float]
|
|
122
|
+
|
|
123
|
+
if TYPE_CHECKING:
|
|
124
|
+
from typing_extensions import Annotated
|
|
125
|
+
|
|
126
|
+
from .dataclasses import Dataclass
|
|
127
|
+
from .main import BaseModel
|
|
128
|
+
from .typing import CallableGenerator
|
|
129
|
+
|
|
130
|
+
ModelOrDc = Type[Union[BaseModel, Dataclass]]
|
|
131
|
+
|
|
132
|
+
T = TypeVar('T')
|
|
133
|
+
_DEFINED_TYPES: 'WeakSet[type]' = WeakSet()
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
@overload
|
|
137
|
+
def _registered(typ: Type[T]) -> Type[T]:
|
|
138
|
+
pass
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
@overload
|
|
142
|
+
def _registered(typ: 'ConstrainedNumberMeta') -> 'ConstrainedNumberMeta':
|
|
143
|
+
pass
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def _registered(typ: Union[Type[T], 'ConstrainedNumberMeta']) -> Union[Type[T], 'ConstrainedNumberMeta']:
|
|
147
|
+
# In order to generate valid examples of constrained types, Hypothesis needs
|
|
148
|
+
# to inspect the type object - so we keep a weakref to each contype object
|
|
149
|
+
# until it can be registered. When (or if) our Hypothesis plugin is loaded,
|
|
150
|
+
# it monkeypatches this function.
|
|
151
|
+
# If Hypothesis is never used, the total effect is to keep a weak reference
|
|
152
|
+
# which has minimal memory usage and doesn't even affect garbage collection.
|
|
153
|
+
_DEFINED_TYPES.add(typ)
|
|
154
|
+
return typ
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class ConstrainedNumberMeta(type):
|
|
158
|
+
def __new__(cls, name: str, bases: Any, dct: Dict[str, Any]) -> 'ConstrainedInt': # type: ignore
|
|
159
|
+
new_cls = cast('ConstrainedInt', type.__new__(cls, name, bases, dct))
|
|
160
|
+
|
|
161
|
+
if new_cls.gt is not None and new_cls.ge is not None:
|
|
162
|
+
raise errors.ConfigError('bounds gt and ge cannot be specified at the same time')
|
|
163
|
+
if new_cls.lt is not None and new_cls.le is not None:
|
|
164
|
+
raise errors.ConfigError('bounds lt and le cannot be specified at the same time')
|
|
165
|
+
|
|
166
|
+
return _registered(new_cls) # type: ignore
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BOOLEAN TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
170
|
+
|
|
171
|
+
if TYPE_CHECKING:
|
|
172
|
+
StrictBool = bool
|
|
173
|
+
else:
|
|
174
|
+
|
|
175
|
+
class StrictBool(int):
|
|
176
|
+
"""
|
|
177
|
+
StrictBool to allow for bools which are not type-coerced.
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
@classmethod
|
|
181
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
182
|
+
field_schema.update(type='boolean')
|
|
183
|
+
|
|
184
|
+
@classmethod
|
|
185
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
186
|
+
yield cls.validate
|
|
187
|
+
|
|
188
|
+
@classmethod
|
|
189
|
+
def validate(cls, value: Any) -> bool:
|
|
190
|
+
"""
|
|
191
|
+
Ensure that we only allow bools.
|
|
192
|
+
"""
|
|
193
|
+
if isinstance(value, bool):
|
|
194
|
+
return value
|
|
195
|
+
|
|
196
|
+
raise errors.StrictBoolError()
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTEGER TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
class ConstrainedInt(int, metaclass=ConstrainedNumberMeta):
|
|
203
|
+
strict: bool = False
|
|
204
|
+
gt: OptionalInt = None
|
|
205
|
+
ge: OptionalInt = None
|
|
206
|
+
lt: OptionalInt = None
|
|
207
|
+
le: OptionalInt = None
|
|
208
|
+
multiple_of: OptionalInt = None
|
|
209
|
+
|
|
210
|
+
@classmethod
|
|
211
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
212
|
+
update_not_none(
|
|
213
|
+
field_schema,
|
|
214
|
+
exclusiveMinimum=cls.gt,
|
|
215
|
+
exclusiveMaximum=cls.lt,
|
|
216
|
+
minimum=cls.ge,
|
|
217
|
+
maximum=cls.le,
|
|
218
|
+
multipleOf=cls.multiple_of,
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
@classmethod
|
|
222
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
223
|
+
yield strict_int_validator if cls.strict else int_validator
|
|
224
|
+
yield number_size_validator
|
|
225
|
+
yield number_multiple_validator
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
def conint(
|
|
229
|
+
*,
|
|
230
|
+
strict: bool = False,
|
|
231
|
+
gt: Optional[int] = None,
|
|
232
|
+
ge: Optional[int] = None,
|
|
233
|
+
lt: Optional[int] = None,
|
|
234
|
+
le: Optional[int] = None,
|
|
235
|
+
multiple_of: Optional[int] = None,
|
|
236
|
+
) -> Type[int]:
|
|
237
|
+
# use kwargs then define conf in a dict to aid with IDE type hinting
|
|
238
|
+
namespace = dict(strict=strict, gt=gt, ge=ge, lt=lt, le=le, multiple_of=multiple_of)
|
|
239
|
+
return type('ConstrainedIntValue', (ConstrainedInt,), namespace)
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
if TYPE_CHECKING:
|
|
243
|
+
PositiveInt = int
|
|
244
|
+
NegativeInt = int
|
|
245
|
+
NonPositiveInt = int
|
|
246
|
+
NonNegativeInt = int
|
|
247
|
+
StrictInt = int
|
|
248
|
+
else:
|
|
249
|
+
|
|
250
|
+
class PositiveInt(ConstrainedInt):
|
|
251
|
+
gt = 0
|
|
252
|
+
|
|
253
|
+
class NegativeInt(ConstrainedInt):
|
|
254
|
+
lt = 0
|
|
255
|
+
|
|
256
|
+
class NonPositiveInt(ConstrainedInt):
|
|
257
|
+
le = 0
|
|
258
|
+
|
|
259
|
+
class NonNegativeInt(ConstrainedInt):
|
|
260
|
+
ge = 0
|
|
261
|
+
|
|
262
|
+
class StrictInt(ConstrainedInt):
|
|
263
|
+
strict = True
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FLOAT TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
class ConstrainedFloat(float, metaclass=ConstrainedNumberMeta):
|
|
270
|
+
strict: bool = False
|
|
271
|
+
gt: OptionalIntFloat = None
|
|
272
|
+
ge: OptionalIntFloat = None
|
|
273
|
+
lt: OptionalIntFloat = None
|
|
274
|
+
le: OptionalIntFloat = None
|
|
275
|
+
multiple_of: OptionalIntFloat = None
|
|
276
|
+
allow_inf_nan: Optional[bool] = None
|
|
277
|
+
|
|
278
|
+
@classmethod
|
|
279
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
280
|
+
update_not_none(
|
|
281
|
+
field_schema,
|
|
282
|
+
exclusiveMinimum=cls.gt,
|
|
283
|
+
exclusiveMaximum=cls.lt,
|
|
284
|
+
minimum=cls.ge,
|
|
285
|
+
maximum=cls.le,
|
|
286
|
+
multipleOf=cls.multiple_of,
|
|
287
|
+
)
|
|
288
|
+
# Modify constraints to account for differences between IEEE floats and JSON
|
|
289
|
+
if field_schema.get('exclusiveMinimum') == -math.inf:
|
|
290
|
+
del field_schema['exclusiveMinimum']
|
|
291
|
+
if field_schema.get('minimum') == -math.inf:
|
|
292
|
+
del field_schema['minimum']
|
|
293
|
+
if field_schema.get('exclusiveMaximum') == math.inf:
|
|
294
|
+
del field_schema['exclusiveMaximum']
|
|
295
|
+
if field_schema.get('maximum') == math.inf:
|
|
296
|
+
del field_schema['maximum']
|
|
297
|
+
|
|
298
|
+
@classmethod
|
|
299
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
300
|
+
yield strict_float_validator if cls.strict else float_validator
|
|
301
|
+
yield number_size_validator
|
|
302
|
+
yield number_multiple_validator
|
|
303
|
+
yield float_finite_validator
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
def confloat(
|
|
307
|
+
*,
|
|
308
|
+
strict: bool = False,
|
|
309
|
+
gt: float = None,
|
|
310
|
+
ge: float = None,
|
|
311
|
+
lt: float = None,
|
|
312
|
+
le: float = None,
|
|
313
|
+
multiple_of: float = None,
|
|
314
|
+
allow_inf_nan: Optional[bool] = None,
|
|
315
|
+
) -> Type[float]:
|
|
316
|
+
# use kwargs then define conf in a dict to aid with IDE type hinting
|
|
317
|
+
namespace = dict(strict=strict, gt=gt, ge=ge, lt=lt, le=le, multiple_of=multiple_of, allow_inf_nan=allow_inf_nan)
|
|
318
|
+
return type('ConstrainedFloatValue', (ConstrainedFloat,), namespace)
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
if TYPE_CHECKING:
|
|
322
|
+
PositiveFloat = float
|
|
323
|
+
NegativeFloat = float
|
|
324
|
+
NonPositiveFloat = float
|
|
325
|
+
NonNegativeFloat = float
|
|
326
|
+
StrictFloat = float
|
|
327
|
+
FiniteFloat = float
|
|
328
|
+
else:
|
|
329
|
+
|
|
330
|
+
class PositiveFloat(ConstrainedFloat):
|
|
331
|
+
gt = 0
|
|
332
|
+
|
|
333
|
+
class NegativeFloat(ConstrainedFloat):
|
|
334
|
+
lt = 0
|
|
335
|
+
|
|
336
|
+
class NonPositiveFloat(ConstrainedFloat):
|
|
337
|
+
le = 0
|
|
338
|
+
|
|
339
|
+
class NonNegativeFloat(ConstrainedFloat):
|
|
340
|
+
ge = 0
|
|
341
|
+
|
|
342
|
+
class StrictFloat(ConstrainedFloat):
|
|
343
|
+
strict = True
|
|
344
|
+
|
|
345
|
+
class FiniteFloat(ConstrainedFloat):
|
|
346
|
+
allow_inf_nan = False
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BYTES TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
class ConstrainedBytes(bytes):
|
|
353
|
+
strip_whitespace = False
|
|
354
|
+
to_upper = False
|
|
355
|
+
to_lower = False
|
|
356
|
+
min_length: OptionalInt = None
|
|
357
|
+
max_length: OptionalInt = None
|
|
358
|
+
strict: bool = False
|
|
359
|
+
|
|
360
|
+
@classmethod
|
|
361
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
362
|
+
update_not_none(field_schema, minLength=cls.min_length, maxLength=cls.max_length)
|
|
363
|
+
|
|
364
|
+
@classmethod
|
|
365
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
366
|
+
yield strict_bytes_validator if cls.strict else bytes_validator
|
|
367
|
+
yield constr_strip_whitespace
|
|
368
|
+
yield constr_upper
|
|
369
|
+
yield constr_lower
|
|
370
|
+
yield constr_length_validator
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
def conbytes(
|
|
374
|
+
*,
|
|
375
|
+
strip_whitespace: bool = False,
|
|
376
|
+
to_upper: bool = False,
|
|
377
|
+
to_lower: bool = False,
|
|
378
|
+
min_length: Optional[int] = None,
|
|
379
|
+
max_length: Optional[int] = None,
|
|
380
|
+
strict: bool = False,
|
|
381
|
+
) -> Type[bytes]:
|
|
382
|
+
# use kwargs then define conf in a dict to aid with IDE type hinting
|
|
383
|
+
namespace = dict(
|
|
384
|
+
strip_whitespace=strip_whitespace,
|
|
385
|
+
to_upper=to_upper,
|
|
386
|
+
to_lower=to_lower,
|
|
387
|
+
min_length=min_length,
|
|
388
|
+
max_length=max_length,
|
|
389
|
+
strict=strict,
|
|
390
|
+
)
|
|
391
|
+
return _registered(type('ConstrainedBytesValue', (ConstrainedBytes,), namespace))
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
if TYPE_CHECKING:
|
|
395
|
+
StrictBytes = bytes
|
|
396
|
+
else:
|
|
397
|
+
|
|
398
|
+
class StrictBytes(ConstrainedBytes):
|
|
399
|
+
strict = True
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ STRING TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
class ConstrainedStr(str):
|
|
406
|
+
strip_whitespace = False
|
|
407
|
+
to_upper = False
|
|
408
|
+
to_lower = False
|
|
409
|
+
min_length: OptionalInt = None
|
|
410
|
+
max_length: OptionalInt = None
|
|
411
|
+
curtail_length: OptionalInt = None
|
|
412
|
+
regex: Optional[Union[str, Pattern[str]]] = None
|
|
413
|
+
strict = False
|
|
414
|
+
|
|
415
|
+
@classmethod
|
|
416
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
417
|
+
update_not_none(
|
|
418
|
+
field_schema,
|
|
419
|
+
minLength=cls.min_length,
|
|
420
|
+
maxLength=cls.max_length,
|
|
421
|
+
pattern=cls.regex and cls._get_pattern(cls.regex),
|
|
422
|
+
)
|
|
423
|
+
|
|
424
|
+
@classmethod
|
|
425
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
426
|
+
yield strict_str_validator if cls.strict else str_validator
|
|
427
|
+
yield constr_strip_whitespace
|
|
428
|
+
yield constr_upper
|
|
429
|
+
yield constr_lower
|
|
430
|
+
yield constr_length_validator
|
|
431
|
+
yield cls.validate
|
|
432
|
+
|
|
433
|
+
@classmethod
|
|
434
|
+
def validate(cls, value: Union[str]) -> Union[str]:
|
|
435
|
+
if cls.curtail_length and len(value) > cls.curtail_length:
|
|
436
|
+
value = value[: cls.curtail_length]
|
|
437
|
+
|
|
438
|
+
if cls.regex:
|
|
439
|
+
if not re.match(cls.regex, value):
|
|
440
|
+
raise errors.StrRegexError(pattern=cls._get_pattern(cls.regex))
|
|
441
|
+
|
|
442
|
+
return value
|
|
443
|
+
|
|
444
|
+
@staticmethod
|
|
445
|
+
def _get_pattern(regex: Union[str, Pattern[str]]) -> str:
|
|
446
|
+
return regex if isinstance(regex, str) else regex.pattern
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
def constr(
|
|
450
|
+
*,
|
|
451
|
+
strip_whitespace: bool = False,
|
|
452
|
+
to_upper: bool = False,
|
|
453
|
+
to_lower: bool = False,
|
|
454
|
+
strict: bool = False,
|
|
455
|
+
min_length: Optional[int] = None,
|
|
456
|
+
max_length: Optional[int] = None,
|
|
457
|
+
curtail_length: Optional[int] = None,
|
|
458
|
+
regex: Optional[str] = None,
|
|
459
|
+
) -> Type[str]:
|
|
460
|
+
# use kwargs then define conf in a dict to aid with IDE type hinting
|
|
461
|
+
namespace = dict(
|
|
462
|
+
strip_whitespace=strip_whitespace,
|
|
463
|
+
to_upper=to_upper,
|
|
464
|
+
to_lower=to_lower,
|
|
465
|
+
strict=strict,
|
|
466
|
+
min_length=min_length,
|
|
467
|
+
max_length=max_length,
|
|
468
|
+
curtail_length=curtail_length,
|
|
469
|
+
regex=regex and re.compile(regex),
|
|
470
|
+
)
|
|
471
|
+
return _registered(type('ConstrainedStrValue', (ConstrainedStr,), namespace))
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
if TYPE_CHECKING:
|
|
475
|
+
StrictStr = str
|
|
476
|
+
else:
|
|
477
|
+
|
|
478
|
+
class StrictStr(ConstrainedStr):
|
|
479
|
+
strict = True
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SET TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
483
|
+
|
|
484
|
+
# This types superclass should be Set[T], but cython chokes on that...
|
|
485
|
+
class ConstrainedSet(set): # type: ignore
|
|
486
|
+
# Needed for pydantic to detect that this is a set
|
|
487
|
+
__origin__ = set
|
|
488
|
+
__args__: Set[Type[T]] # type: ignore
|
|
489
|
+
|
|
490
|
+
min_items: Optional[int] = None
|
|
491
|
+
max_items: Optional[int] = None
|
|
492
|
+
item_type: Type[T] # type: ignore
|
|
493
|
+
|
|
494
|
+
@classmethod
|
|
495
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
496
|
+
yield cls.set_length_validator
|
|
497
|
+
|
|
498
|
+
@classmethod
|
|
499
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
500
|
+
update_not_none(field_schema, minItems=cls.min_items, maxItems=cls.max_items)
|
|
501
|
+
|
|
502
|
+
@classmethod
|
|
503
|
+
def set_length_validator(cls, v: 'Optional[Set[T]]') -> 'Optional[Set[T]]':
|
|
504
|
+
if v is None:
|
|
505
|
+
return None
|
|
506
|
+
|
|
507
|
+
v = set_validator(v)
|
|
508
|
+
v_len = len(v)
|
|
509
|
+
|
|
510
|
+
if cls.min_items is not None and v_len < cls.min_items:
|
|
511
|
+
raise errors.SetMinLengthError(limit_value=cls.min_items)
|
|
512
|
+
|
|
513
|
+
if cls.max_items is not None and v_len > cls.max_items:
|
|
514
|
+
raise errors.SetMaxLengthError(limit_value=cls.max_items)
|
|
515
|
+
|
|
516
|
+
return v
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
def conset(item_type: Type[T], *, min_items: Optional[int] = None, max_items: Optional[int] = None) -> Type[Set[T]]:
|
|
520
|
+
# __args__ is needed to conform to typing generics api
|
|
521
|
+
namespace = {'min_items': min_items, 'max_items': max_items, 'item_type': item_type, '__args__': [item_type]}
|
|
522
|
+
# We use new_class to be able to deal with Generic types
|
|
523
|
+
return new_class('ConstrainedSetValue', (ConstrainedSet,), {}, lambda ns: ns.update(namespace))
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
# This types superclass should be FrozenSet[T], but cython chokes on that...
|
|
527
|
+
class ConstrainedFrozenSet(frozenset): # type: ignore
|
|
528
|
+
# Needed for pydantic to detect that this is a set
|
|
529
|
+
__origin__ = frozenset
|
|
530
|
+
__args__: FrozenSet[Type[T]] # type: ignore
|
|
531
|
+
|
|
532
|
+
min_items: Optional[int] = None
|
|
533
|
+
max_items: Optional[int] = None
|
|
534
|
+
item_type: Type[T] # type: ignore
|
|
535
|
+
|
|
536
|
+
@classmethod
|
|
537
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
538
|
+
yield cls.frozenset_length_validator
|
|
539
|
+
|
|
540
|
+
@classmethod
|
|
541
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
542
|
+
update_not_none(field_schema, minItems=cls.min_items, maxItems=cls.max_items)
|
|
543
|
+
|
|
544
|
+
@classmethod
|
|
545
|
+
def frozenset_length_validator(cls, v: 'Optional[FrozenSet[T]]') -> 'Optional[FrozenSet[T]]':
|
|
546
|
+
if v is None:
|
|
547
|
+
return None
|
|
548
|
+
|
|
549
|
+
v = frozenset_validator(v)
|
|
550
|
+
v_len = len(v)
|
|
551
|
+
|
|
552
|
+
if cls.min_items is not None and v_len < cls.min_items:
|
|
553
|
+
raise errors.FrozenSetMinLengthError(limit_value=cls.min_items)
|
|
554
|
+
|
|
555
|
+
if cls.max_items is not None and v_len > cls.max_items:
|
|
556
|
+
raise errors.FrozenSetMaxLengthError(limit_value=cls.max_items)
|
|
557
|
+
|
|
558
|
+
return v
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
def confrozenset(
|
|
562
|
+
item_type: Type[T], *, min_items: Optional[int] = None, max_items: Optional[int] = None
|
|
563
|
+
) -> Type[FrozenSet[T]]:
|
|
564
|
+
# __args__ is needed to conform to typing generics api
|
|
565
|
+
namespace = {'min_items': min_items, 'max_items': max_items, 'item_type': item_type, '__args__': [item_type]}
|
|
566
|
+
# We use new_class to be able to deal with Generic types
|
|
567
|
+
return new_class('ConstrainedFrozenSetValue', (ConstrainedFrozenSet,), {}, lambda ns: ns.update(namespace))
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LIST TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
571
|
+
|
|
572
|
+
# This types superclass should be List[T], but cython chokes on that...
|
|
573
|
+
class ConstrainedList(list): # type: ignore
|
|
574
|
+
# Needed for pydantic to detect that this is a list
|
|
575
|
+
__origin__ = list
|
|
576
|
+
__args__: Tuple[Type[T], ...] # type: ignore
|
|
577
|
+
|
|
578
|
+
min_items: Optional[int] = None
|
|
579
|
+
max_items: Optional[int] = None
|
|
580
|
+
unique_items: Optional[bool] = None
|
|
581
|
+
item_type: Type[T] # type: ignore
|
|
582
|
+
|
|
583
|
+
@classmethod
|
|
584
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
585
|
+
yield cls.list_length_validator
|
|
586
|
+
if cls.unique_items:
|
|
587
|
+
yield cls.unique_items_validator
|
|
588
|
+
|
|
589
|
+
@classmethod
|
|
590
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
591
|
+
update_not_none(field_schema, minItems=cls.min_items, maxItems=cls.max_items, uniqueItems=cls.unique_items)
|
|
592
|
+
|
|
593
|
+
@classmethod
|
|
594
|
+
def list_length_validator(cls, v: 'Optional[List[T]]') -> 'Optional[List[T]]':
|
|
595
|
+
if v is None:
|
|
596
|
+
return None
|
|
597
|
+
|
|
598
|
+
v = list_validator(v)
|
|
599
|
+
v_len = len(v)
|
|
600
|
+
|
|
601
|
+
if cls.min_items is not None and v_len < cls.min_items:
|
|
602
|
+
raise errors.ListMinLengthError(limit_value=cls.min_items)
|
|
603
|
+
|
|
604
|
+
if cls.max_items is not None and v_len > cls.max_items:
|
|
605
|
+
raise errors.ListMaxLengthError(limit_value=cls.max_items)
|
|
606
|
+
|
|
607
|
+
return v
|
|
608
|
+
|
|
609
|
+
@classmethod
|
|
610
|
+
def unique_items_validator(cls, v: 'Optional[List[T]]') -> 'Optional[List[T]]':
|
|
611
|
+
if v is None:
|
|
612
|
+
return None
|
|
613
|
+
|
|
614
|
+
for i, value in enumerate(v, start=1):
|
|
615
|
+
if value in v[i:]:
|
|
616
|
+
raise errors.ListUniqueItemsError()
|
|
617
|
+
|
|
618
|
+
return v
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
def conlist(
|
|
622
|
+
item_type: Type[T], *, min_items: Optional[int] = None, max_items: Optional[int] = None, unique_items: bool = None
|
|
623
|
+
) -> Type[List[T]]:
|
|
624
|
+
# __args__ is needed to conform to typing generics api
|
|
625
|
+
namespace = dict(
|
|
626
|
+
min_items=min_items, max_items=max_items, unique_items=unique_items, item_type=item_type, __args__=(item_type,)
|
|
627
|
+
)
|
|
628
|
+
# We use new_class to be able to deal with Generic types
|
|
629
|
+
return new_class('ConstrainedListValue', (ConstrainedList,), {}, lambda ns: ns.update(namespace))
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PYOBJECT TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
if TYPE_CHECKING:
|
|
636
|
+
PyObject = Callable[..., Any]
|
|
637
|
+
else:
|
|
638
|
+
|
|
639
|
+
class PyObject:
|
|
640
|
+
validate_always = True
|
|
641
|
+
|
|
642
|
+
@classmethod
|
|
643
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
644
|
+
yield cls.validate
|
|
645
|
+
|
|
646
|
+
@classmethod
|
|
647
|
+
def validate(cls, value: Any) -> Any:
|
|
648
|
+
if isinstance(value, Callable):
|
|
649
|
+
return value
|
|
650
|
+
|
|
651
|
+
try:
|
|
652
|
+
value = str_validator(value)
|
|
653
|
+
except errors.StrError:
|
|
654
|
+
raise errors.PyObjectError(error_message='value is neither a valid import path not a valid callable')
|
|
655
|
+
|
|
656
|
+
try:
|
|
657
|
+
return import_string(value)
|
|
658
|
+
except ImportError as e:
|
|
659
|
+
raise errors.PyObjectError(error_message=str(e))
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECIMAL TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
class ConstrainedDecimal(Decimal, metaclass=ConstrainedNumberMeta):
|
|
666
|
+
gt: OptionalIntFloatDecimal = None
|
|
667
|
+
ge: OptionalIntFloatDecimal = None
|
|
668
|
+
lt: OptionalIntFloatDecimal = None
|
|
669
|
+
le: OptionalIntFloatDecimal = None
|
|
670
|
+
max_digits: OptionalInt = None
|
|
671
|
+
decimal_places: OptionalInt = None
|
|
672
|
+
multiple_of: OptionalIntFloatDecimal = None
|
|
673
|
+
|
|
674
|
+
@classmethod
|
|
675
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
676
|
+
update_not_none(
|
|
677
|
+
field_schema,
|
|
678
|
+
exclusiveMinimum=cls.gt,
|
|
679
|
+
exclusiveMaximum=cls.lt,
|
|
680
|
+
minimum=cls.ge,
|
|
681
|
+
maximum=cls.le,
|
|
682
|
+
multipleOf=cls.multiple_of,
|
|
683
|
+
)
|
|
684
|
+
|
|
685
|
+
@classmethod
|
|
686
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
687
|
+
yield decimal_validator
|
|
688
|
+
yield number_size_validator
|
|
689
|
+
yield number_multiple_validator
|
|
690
|
+
yield cls.validate
|
|
691
|
+
|
|
692
|
+
@classmethod
|
|
693
|
+
def validate(cls, value: Decimal) -> Decimal:
|
|
694
|
+
try:
|
|
695
|
+
normalized_value = value.normalize()
|
|
696
|
+
except InvalidOperation:
|
|
697
|
+
normalized_value = value
|
|
698
|
+
digit_tuple, exponent = normalized_value.as_tuple()[1:]
|
|
699
|
+
if exponent in {'F', 'n', 'N'}:
|
|
700
|
+
raise errors.DecimalIsNotFiniteError()
|
|
701
|
+
|
|
702
|
+
if exponent >= 0:
|
|
703
|
+
# A positive exponent adds that many trailing zeros.
|
|
704
|
+
digits = len(digit_tuple) + exponent
|
|
705
|
+
decimals = 0
|
|
706
|
+
else:
|
|
707
|
+
# If the absolute value of the negative exponent is larger than the
|
|
708
|
+
# number of digits, then it's the same as the number of digits,
|
|
709
|
+
# because it'll consume all of the digits in digit_tuple and then
|
|
710
|
+
# add abs(exponent) - len(digit_tuple) leading zeros after the
|
|
711
|
+
# decimal point.
|
|
712
|
+
if abs(exponent) > len(digit_tuple):
|
|
713
|
+
digits = decimals = abs(exponent)
|
|
714
|
+
else:
|
|
715
|
+
digits = len(digit_tuple)
|
|
716
|
+
decimals = abs(exponent)
|
|
717
|
+
whole_digits = digits - decimals
|
|
718
|
+
|
|
719
|
+
if cls.max_digits is not None and digits > cls.max_digits:
|
|
720
|
+
raise errors.DecimalMaxDigitsError(max_digits=cls.max_digits)
|
|
721
|
+
|
|
722
|
+
if cls.decimal_places is not None and decimals > cls.decimal_places:
|
|
723
|
+
raise errors.DecimalMaxPlacesError(decimal_places=cls.decimal_places)
|
|
724
|
+
|
|
725
|
+
if cls.max_digits is not None and cls.decimal_places is not None:
|
|
726
|
+
expected = cls.max_digits - cls.decimal_places
|
|
727
|
+
if whole_digits > expected:
|
|
728
|
+
raise errors.DecimalWholeDigitsError(whole_digits=expected)
|
|
729
|
+
|
|
730
|
+
return value
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
def condecimal(
|
|
734
|
+
*,
|
|
735
|
+
gt: Decimal = None,
|
|
736
|
+
ge: Decimal = None,
|
|
737
|
+
lt: Decimal = None,
|
|
738
|
+
le: Decimal = None,
|
|
739
|
+
max_digits: Optional[int] = None,
|
|
740
|
+
decimal_places: Optional[int] = None,
|
|
741
|
+
multiple_of: Decimal = None,
|
|
742
|
+
) -> Type[Decimal]:
|
|
743
|
+
# use kwargs then define conf in a dict to aid with IDE type hinting
|
|
744
|
+
namespace = dict(
|
|
745
|
+
gt=gt, ge=ge, lt=lt, le=le, max_digits=max_digits, decimal_places=decimal_places, multiple_of=multiple_of
|
|
746
|
+
)
|
|
747
|
+
return type('ConstrainedDecimalValue', (ConstrainedDecimal,), namespace)
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UUID TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
751
|
+
|
|
752
|
+
if TYPE_CHECKING:
|
|
753
|
+
UUID1 = UUID
|
|
754
|
+
UUID3 = UUID
|
|
755
|
+
UUID4 = UUID
|
|
756
|
+
UUID5 = UUID
|
|
757
|
+
else:
|
|
758
|
+
|
|
759
|
+
class UUID1(UUID):
|
|
760
|
+
_required_version = 1
|
|
761
|
+
|
|
762
|
+
@classmethod
|
|
763
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
764
|
+
field_schema.update(type='string', format=f'uuid{cls._required_version}')
|
|
765
|
+
|
|
766
|
+
class UUID3(UUID1):
|
|
767
|
+
_required_version = 3
|
|
768
|
+
|
|
769
|
+
class UUID4(UUID1):
|
|
770
|
+
_required_version = 4
|
|
771
|
+
|
|
772
|
+
class UUID5(UUID1):
|
|
773
|
+
_required_version = 5
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PATH TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
777
|
+
|
|
778
|
+
if TYPE_CHECKING:
|
|
779
|
+
FilePath = Path
|
|
780
|
+
DirectoryPath = Path
|
|
781
|
+
else:
|
|
782
|
+
|
|
783
|
+
class FilePath(Path):
|
|
784
|
+
@classmethod
|
|
785
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
786
|
+
field_schema.update(format='file-path')
|
|
787
|
+
|
|
788
|
+
@classmethod
|
|
789
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
790
|
+
yield path_validator
|
|
791
|
+
yield path_exists_validator
|
|
792
|
+
yield cls.validate
|
|
793
|
+
|
|
794
|
+
@classmethod
|
|
795
|
+
def validate(cls, value: Path) -> Path:
|
|
796
|
+
if not value.is_file():
|
|
797
|
+
raise errors.PathNotAFileError(path=value)
|
|
798
|
+
|
|
799
|
+
return value
|
|
800
|
+
|
|
801
|
+
class DirectoryPath(Path):
|
|
802
|
+
@classmethod
|
|
803
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
804
|
+
field_schema.update(format='directory-path')
|
|
805
|
+
|
|
806
|
+
@classmethod
|
|
807
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
808
|
+
yield path_validator
|
|
809
|
+
yield path_exists_validator
|
|
810
|
+
yield cls.validate
|
|
811
|
+
|
|
812
|
+
@classmethod
|
|
813
|
+
def validate(cls, value: Path) -> Path:
|
|
814
|
+
if not value.is_dir():
|
|
815
|
+
raise errors.PathNotADirectoryError(path=value)
|
|
816
|
+
|
|
817
|
+
return value
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JSON TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
class JsonWrapper:
|
|
824
|
+
pass
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
class JsonMeta(type):
|
|
828
|
+
def __getitem__(self, t: Type[Any]) -> Type[JsonWrapper]:
|
|
829
|
+
if t is Any:
|
|
830
|
+
return Json # allow Json[Any] to replecate plain Json
|
|
831
|
+
return _registered(type('JsonWrapperValue', (JsonWrapper,), {'inner_type': t}))
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
if TYPE_CHECKING:
|
|
835
|
+
Json = Annotated[T, ...] # Json[list[str]] will be recognized by type checkers as list[str]
|
|
836
|
+
|
|
837
|
+
else:
|
|
838
|
+
|
|
839
|
+
class Json(metaclass=JsonMeta):
|
|
840
|
+
@classmethod
|
|
841
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
842
|
+
field_schema.update(type='string', format='json-string')
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SECRET TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
class SecretField(abc.ABC):
|
|
849
|
+
"""
|
|
850
|
+
Note: this should be implemented as a generic like `SecretField(ABC, Generic[T])`,
|
|
851
|
+
the `__init__()` should be part of the abstract class and the
|
|
852
|
+
`get_secret_value()` method should use the generic `T` type.
|
|
853
|
+
|
|
854
|
+
However Cython doesn't support very well generics at the moment and
|
|
855
|
+
the generated code fails to be imported (see
|
|
856
|
+
https://github.com/cython/cython/issues/2753).
|
|
857
|
+
"""
|
|
858
|
+
|
|
859
|
+
def __eq__(self, other: Any) -> bool:
|
|
860
|
+
return isinstance(other, self.__class__) and self.get_secret_value() == other.get_secret_value()
|
|
861
|
+
|
|
862
|
+
def __str__(self) -> str:
|
|
863
|
+
return '**********' if self.get_secret_value() else ''
|
|
864
|
+
|
|
865
|
+
def __hash__(self) -> int:
|
|
866
|
+
return hash(self.get_secret_value())
|
|
867
|
+
|
|
868
|
+
@abc.abstractmethod
|
|
869
|
+
def get_secret_value(self) -> Any: # pragma: no cover
|
|
870
|
+
...
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
class SecretStr(SecretField):
|
|
874
|
+
min_length: OptionalInt = None
|
|
875
|
+
max_length: OptionalInt = None
|
|
876
|
+
|
|
877
|
+
@classmethod
|
|
878
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
879
|
+
update_not_none(
|
|
880
|
+
field_schema,
|
|
881
|
+
type='string',
|
|
882
|
+
writeOnly=True,
|
|
883
|
+
format='password',
|
|
884
|
+
minLength=cls.min_length,
|
|
885
|
+
maxLength=cls.max_length,
|
|
886
|
+
)
|
|
887
|
+
|
|
888
|
+
@classmethod
|
|
889
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
890
|
+
yield cls.validate
|
|
891
|
+
yield constr_length_validator
|
|
892
|
+
|
|
893
|
+
@classmethod
|
|
894
|
+
def validate(cls, value: Any) -> 'SecretStr':
|
|
895
|
+
if isinstance(value, cls):
|
|
896
|
+
return value
|
|
897
|
+
value = str_validator(value)
|
|
898
|
+
return cls(value)
|
|
899
|
+
|
|
900
|
+
def __init__(self, value: str):
|
|
901
|
+
self._secret_value = value
|
|
902
|
+
|
|
903
|
+
def __repr__(self) -> str:
|
|
904
|
+
return f"SecretStr('{self}')"
|
|
905
|
+
|
|
906
|
+
def __len__(self) -> int:
|
|
907
|
+
return len(self._secret_value)
|
|
908
|
+
|
|
909
|
+
def display(self) -> str:
|
|
910
|
+
warnings.warn('`secret_str.display()` is deprecated, use `str(secret_str)` instead', DeprecationWarning)
|
|
911
|
+
return str(self)
|
|
912
|
+
|
|
913
|
+
def get_secret_value(self) -> str:
|
|
914
|
+
return self._secret_value
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
class SecretBytes(SecretField):
|
|
918
|
+
min_length: OptionalInt = None
|
|
919
|
+
max_length: OptionalInt = None
|
|
920
|
+
|
|
921
|
+
@classmethod
|
|
922
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
923
|
+
update_not_none(
|
|
924
|
+
field_schema,
|
|
925
|
+
type='string',
|
|
926
|
+
writeOnly=True,
|
|
927
|
+
format='password',
|
|
928
|
+
minLength=cls.min_length,
|
|
929
|
+
maxLength=cls.max_length,
|
|
930
|
+
)
|
|
931
|
+
|
|
932
|
+
@classmethod
|
|
933
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
934
|
+
yield cls.validate
|
|
935
|
+
yield constr_length_validator
|
|
936
|
+
|
|
937
|
+
@classmethod
|
|
938
|
+
def validate(cls, value: Any) -> 'SecretBytes':
|
|
939
|
+
if isinstance(value, cls):
|
|
940
|
+
return value
|
|
941
|
+
value = bytes_validator(value)
|
|
942
|
+
return cls(value)
|
|
943
|
+
|
|
944
|
+
def __init__(self, value: bytes):
|
|
945
|
+
self._secret_value = value
|
|
946
|
+
|
|
947
|
+
def __repr__(self) -> str:
|
|
948
|
+
return f"SecretBytes(b'{self}')"
|
|
949
|
+
|
|
950
|
+
def __len__(self) -> int:
|
|
951
|
+
return len(self._secret_value)
|
|
952
|
+
|
|
953
|
+
def display(self) -> str:
|
|
954
|
+
warnings.warn('`secret_bytes.display()` is deprecated, use `str(secret_bytes)` instead', DeprecationWarning)
|
|
955
|
+
return str(self)
|
|
956
|
+
|
|
957
|
+
def get_secret_value(self) -> bytes:
|
|
958
|
+
return self._secret_value
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PAYMENT CARD TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
class PaymentCardBrand(str, Enum):
|
|
965
|
+
# If you add another card type, please also add it to the
|
|
966
|
+
# Hypothesis strategy in `pydantic._hypothesis_plugin`.
|
|
967
|
+
amex = 'American Express'
|
|
968
|
+
mastercard = 'Mastercard'
|
|
969
|
+
visa = 'Visa'
|
|
970
|
+
other = 'other'
|
|
971
|
+
|
|
972
|
+
def __str__(self) -> str:
|
|
973
|
+
return self.value
|
|
974
|
+
|
|
975
|
+
|
|
976
|
+
class PaymentCardNumber(str):
|
|
977
|
+
"""
|
|
978
|
+
Based on: https://en.wikipedia.org/wiki/Payment_card_number
|
|
979
|
+
"""
|
|
980
|
+
|
|
981
|
+
strip_whitespace: ClassVar[bool] = True
|
|
982
|
+
min_length: ClassVar[int] = 12
|
|
983
|
+
max_length: ClassVar[int] = 19
|
|
984
|
+
bin: str
|
|
985
|
+
last4: str
|
|
986
|
+
brand: PaymentCardBrand
|
|
987
|
+
|
|
988
|
+
def __init__(self, card_number: str):
|
|
989
|
+
self.bin = card_number[:6]
|
|
990
|
+
self.last4 = card_number[-4:]
|
|
991
|
+
self.brand = self._get_brand(card_number)
|
|
992
|
+
|
|
993
|
+
@classmethod
|
|
994
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
995
|
+
yield str_validator
|
|
996
|
+
yield constr_strip_whitespace
|
|
997
|
+
yield constr_length_validator
|
|
998
|
+
yield cls.validate_digits
|
|
999
|
+
yield cls.validate_luhn_check_digit
|
|
1000
|
+
yield cls
|
|
1001
|
+
yield cls.validate_length_for_brand
|
|
1002
|
+
|
|
1003
|
+
@property
|
|
1004
|
+
def masked(self) -> str:
|
|
1005
|
+
num_masked = len(self) - 10 # len(bin) + len(last4) == 10
|
|
1006
|
+
return f'{self.bin}{"*" * num_masked}{self.last4}'
|
|
1007
|
+
|
|
1008
|
+
@classmethod
|
|
1009
|
+
def validate_digits(cls, card_number: str) -> str:
|
|
1010
|
+
if not card_number.isdigit():
|
|
1011
|
+
raise errors.NotDigitError
|
|
1012
|
+
return card_number
|
|
1013
|
+
|
|
1014
|
+
@classmethod
|
|
1015
|
+
def validate_luhn_check_digit(cls, card_number: str) -> str:
|
|
1016
|
+
"""
|
|
1017
|
+
Based on: https://en.wikipedia.org/wiki/Luhn_algorithm
|
|
1018
|
+
"""
|
|
1019
|
+
sum_ = int(card_number[-1])
|
|
1020
|
+
length = len(card_number)
|
|
1021
|
+
parity = length % 2
|
|
1022
|
+
for i in range(length - 1):
|
|
1023
|
+
digit = int(card_number[i])
|
|
1024
|
+
if i % 2 == parity:
|
|
1025
|
+
digit *= 2
|
|
1026
|
+
if digit > 9:
|
|
1027
|
+
digit -= 9
|
|
1028
|
+
sum_ += digit
|
|
1029
|
+
valid = sum_ % 10 == 0
|
|
1030
|
+
if not valid:
|
|
1031
|
+
raise errors.LuhnValidationError
|
|
1032
|
+
return card_number
|
|
1033
|
+
|
|
1034
|
+
@classmethod
|
|
1035
|
+
def validate_length_for_brand(cls, card_number: 'PaymentCardNumber') -> 'PaymentCardNumber':
|
|
1036
|
+
"""
|
|
1037
|
+
Validate length based on BIN for major brands:
|
|
1038
|
+
https://en.wikipedia.org/wiki/Payment_card_number#Issuer_identification_number_(IIN)
|
|
1039
|
+
"""
|
|
1040
|
+
required_length: Union[None, int, str] = None
|
|
1041
|
+
if card_number.brand in PaymentCardBrand.mastercard:
|
|
1042
|
+
required_length = 16
|
|
1043
|
+
valid = len(card_number) == required_length
|
|
1044
|
+
elif card_number.brand == PaymentCardBrand.visa:
|
|
1045
|
+
required_length = '13, 16 or 19'
|
|
1046
|
+
valid = len(card_number) in {13, 16, 19}
|
|
1047
|
+
elif card_number.brand == PaymentCardBrand.amex:
|
|
1048
|
+
required_length = 15
|
|
1049
|
+
valid = len(card_number) == required_length
|
|
1050
|
+
else:
|
|
1051
|
+
valid = True
|
|
1052
|
+
if not valid:
|
|
1053
|
+
raise errors.InvalidLengthForBrand(brand=card_number.brand, required_length=required_length)
|
|
1054
|
+
return card_number
|
|
1055
|
+
|
|
1056
|
+
@staticmethod
|
|
1057
|
+
def _get_brand(card_number: str) -> PaymentCardBrand:
|
|
1058
|
+
if card_number[0] == '4':
|
|
1059
|
+
brand = PaymentCardBrand.visa
|
|
1060
|
+
elif 51 <= int(card_number[:2]) <= 55:
|
|
1061
|
+
brand = PaymentCardBrand.mastercard
|
|
1062
|
+
elif card_number[:2] in {'34', '37'}:
|
|
1063
|
+
brand = PaymentCardBrand.amex
|
|
1064
|
+
else:
|
|
1065
|
+
brand = PaymentCardBrand.other
|
|
1066
|
+
return brand
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BYTE SIZE TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
1070
|
+
|
|
1071
|
+
BYTE_SIZES = {
|
|
1072
|
+
'b': 1,
|
|
1073
|
+
'kb': 10**3,
|
|
1074
|
+
'mb': 10**6,
|
|
1075
|
+
'gb': 10**9,
|
|
1076
|
+
'tb': 10**12,
|
|
1077
|
+
'pb': 10**15,
|
|
1078
|
+
'eb': 10**18,
|
|
1079
|
+
'kib': 2**10,
|
|
1080
|
+
'mib': 2**20,
|
|
1081
|
+
'gib': 2**30,
|
|
1082
|
+
'tib': 2**40,
|
|
1083
|
+
'pib': 2**50,
|
|
1084
|
+
'eib': 2**60,
|
|
1085
|
+
}
|
|
1086
|
+
BYTE_SIZES.update({k.lower()[0]: v for k, v in BYTE_SIZES.items() if 'i' not in k})
|
|
1087
|
+
byte_string_re = re.compile(r'^\s*(\d*\.?\d+)\s*(\w+)?', re.IGNORECASE)
|
|
1088
|
+
|
|
1089
|
+
|
|
1090
|
+
class ByteSize(int):
|
|
1091
|
+
@classmethod
|
|
1092
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
1093
|
+
yield cls.validate
|
|
1094
|
+
|
|
1095
|
+
@classmethod
|
|
1096
|
+
def validate(cls, v: StrIntFloat) -> 'ByteSize':
|
|
1097
|
+
|
|
1098
|
+
try:
|
|
1099
|
+
return cls(int(v))
|
|
1100
|
+
except ValueError:
|
|
1101
|
+
pass
|
|
1102
|
+
|
|
1103
|
+
str_match = byte_string_re.match(str(v))
|
|
1104
|
+
if str_match is None:
|
|
1105
|
+
raise errors.InvalidByteSize()
|
|
1106
|
+
|
|
1107
|
+
scalar, unit = str_match.groups()
|
|
1108
|
+
if unit is None:
|
|
1109
|
+
unit = 'b'
|
|
1110
|
+
|
|
1111
|
+
try:
|
|
1112
|
+
unit_mult = BYTE_SIZES[unit.lower()]
|
|
1113
|
+
except KeyError:
|
|
1114
|
+
raise errors.InvalidByteSizeUnit(unit=unit)
|
|
1115
|
+
|
|
1116
|
+
return cls(int(float(scalar) * unit_mult))
|
|
1117
|
+
|
|
1118
|
+
def human_readable(self, decimal: bool = False) -> str:
|
|
1119
|
+
|
|
1120
|
+
if decimal:
|
|
1121
|
+
divisor = 1000
|
|
1122
|
+
units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']
|
|
1123
|
+
final_unit = 'EB'
|
|
1124
|
+
else:
|
|
1125
|
+
divisor = 1024
|
|
1126
|
+
units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB']
|
|
1127
|
+
final_unit = 'EiB'
|
|
1128
|
+
|
|
1129
|
+
num = float(self)
|
|
1130
|
+
for unit in units:
|
|
1131
|
+
if abs(num) < divisor:
|
|
1132
|
+
return f'{num:0.1f}{unit}'
|
|
1133
|
+
num /= divisor
|
|
1134
|
+
|
|
1135
|
+
return f'{num:0.1f}{final_unit}'
|
|
1136
|
+
|
|
1137
|
+
def to(self, unit: str) -> float:
|
|
1138
|
+
|
|
1139
|
+
try:
|
|
1140
|
+
unit_div = BYTE_SIZES[unit.lower()]
|
|
1141
|
+
except KeyError:
|
|
1142
|
+
raise errors.InvalidByteSizeUnit(unit=unit)
|
|
1143
|
+
|
|
1144
|
+
return self / unit_div
|
|
1145
|
+
|
|
1146
|
+
|
|
1147
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DATE TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
1148
|
+
|
|
1149
|
+
if TYPE_CHECKING:
|
|
1150
|
+
PastDate = date
|
|
1151
|
+
FutureDate = date
|
|
1152
|
+
else:
|
|
1153
|
+
|
|
1154
|
+
class PastDate(date):
|
|
1155
|
+
@classmethod
|
|
1156
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
1157
|
+
yield parse_date
|
|
1158
|
+
yield cls.validate
|
|
1159
|
+
|
|
1160
|
+
@classmethod
|
|
1161
|
+
def validate(cls, value: date) -> date:
|
|
1162
|
+
if value >= date.today():
|
|
1163
|
+
raise errors.DateNotInThePastError()
|
|
1164
|
+
|
|
1165
|
+
return value
|
|
1166
|
+
|
|
1167
|
+
class FutureDate(date):
|
|
1168
|
+
@classmethod
|
|
1169
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
1170
|
+
yield parse_date
|
|
1171
|
+
yield cls.validate
|
|
1172
|
+
|
|
1173
|
+
@classmethod
|
|
1174
|
+
def validate(cls, value: date) -> date:
|
|
1175
|
+
if value <= date.today():
|
|
1176
|
+
raise errors.DateNotInTheFutureError()
|
|
1177
|
+
|
|
1178
|
+
return value
|
|
1179
|
+
|
|
1180
|
+
|
|
1181
|
+
class ConstrainedDate(date, metaclass=ConstrainedNumberMeta):
|
|
1182
|
+
gt: OptionalDate = None
|
|
1183
|
+
ge: OptionalDate = None
|
|
1184
|
+
lt: OptionalDate = None
|
|
1185
|
+
le: OptionalDate = None
|
|
1186
|
+
|
|
1187
|
+
@classmethod
|
|
1188
|
+
def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:
|
|
1189
|
+
update_not_none(field_schema, exclusiveMinimum=cls.gt, exclusiveMaximum=cls.lt, minimum=cls.ge, maximum=cls.le)
|
|
1190
|
+
|
|
1191
|
+
@classmethod
|
|
1192
|
+
def __get_validators__(cls) -> 'CallableGenerator':
|
|
1193
|
+
yield parse_date
|
|
1194
|
+
yield number_size_validator
|
|
1195
|
+
|
|
1196
|
+
|
|
1197
|
+
def condate(
|
|
1198
|
+
*,
|
|
1199
|
+
gt: date = None,
|
|
1200
|
+
ge: date = None,
|
|
1201
|
+
lt: date = None,
|
|
1202
|
+
le: date = None,
|
|
1203
|
+
) -> Type[date]:
|
|
1204
|
+
# use kwargs then define conf in a dict to aid with IDE type hinting
|
|
1205
|
+
namespace = dict(gt=gt, ge=ge, lt=lt, le=le)
|
|
1206
|
+
return type('ConstrainedDateValue', (ConstrainedDate,), namespace)
|