google-aiplatform1_beta1

一个完整的库,用于与Aiplatform(协议v1beta1)交互

1个稳定版本

5.0.5+20240715 2024年7月25日

#2514 in 网络编程

Download history 114/week @ 2024-07-21 15/week @ 2024-07-28

129 每月下载量

MIT 许可证

10MB
118K SLoC

google-aiplatform1_beta1库允许访问Google Aiplatform服务的所有功能。

本文档是从Aiplatform crate版本5.0.5+20240715生成的,其中20240715mako代码生成器v5.0.5构建的aiplatform:v1beta1架构的确切修订版本。

有关Aiplatform v1_beta1 API的更多信息,请参阅官方文档站点

功能

轻松从中央枢纽处理以下资源...

支持以下上传...

此库的结构

API被组织成以下主要项目

  • 枢纽
  • 资源
    • 可以应用活动的主要类型
    • 属性和部分的集合
    • 部分
      • 属性的集合
      • 不在活动中直接使用
  • 活动
    • 应用于资源的操作

所有结构都标记了适用的特质,以进一步分类它们并简化浏览。

一般来说,您可以像这样调用活动

let r = hub.resource().activity(...).doit().await

或具体地...

let r = hub.projects().locations_notebook_runtimes_operations_get(...).doit().await
let r = hub.projects().locations_notebook_runtimes_operations_wait(...).doit().await
let r = hub.projects().locations_notebook_runtimes_assign(...).doit().await
let r = hub.projects().locations_notebook_runtimes_upgrade(...).doit().await
let r = hub.projects().locations_notebook_runtimes_delete(...).doit().await
let r = hub.projects().locations_notebook_runtimes_start(...).doit().await
let r = hub.projects().locations_apps_operations_wait(...).doit().await
let r = hub.projects().locations_apps_operations_get(...).doit().await
let r = hub.projects().locations_notebook_runtime_templates_operations_wait(...).doit().await
let r = hub.projects().locations_notebook_runtime_templates_operations_get(...).doit().await
let r = hub.projects().locations_notebook_runtime_templates_delete(...).doit().await
let r = hub.projects().locations_notebook_runtime_templates_create(...).doit().await
let r = hub.projects().locations_hyperparameter_tuning_jobs_operations_get(...).doit().await
let r = hub.projects().locations_hyperparameter_tuning_jobs_operations_wait(...).doit().await
let r = hub.projects().locations_hyperparameter_tuning_jobs_delete(...).doit().await
let r = hub.projects().locations_endpoints_operations_wait(...).doit().await
let r = hub.projects().locations_endpoints_operations_get(...).doit().await
let r = hub.projects().locations_endpoints_deploy_model(...).doit().await
let r = hub.projects().locations_endpoints_create(...).doit().await
let r = hub.projects().locations_endpoints_undeploy_model(...).doit().await
let r = hub.projects().locations_endpoints_delete(...).doit().await
let r = hub.projects().locations_endpoints_mutate_deployed_model(...).doit().await
let r = hub.projects().locations_schedules_operations_wait(...).doit().await
let r = hub.projects().locations_schedules_operations_get(...).doit().await
let r = hub.projects().locations_schedules_delete(...).doit().await
let r = hub.projects().locations_nas_jobs_delete(...).doit().await
let r = hub.projects().locations_edge_devices_operations_get(...).doit().await
let r = hub.projects().locations_edge_devices_operations_wait(...).doit().await
let r = hub.projects().locations_extensions_operations_wait(...).doit().await
let r = hub.projects().locations_extensions_operations_get(...).doit().await
let r = hub.projects().locations_extensions_delete(...).doit().await
let r = hub.projects().locations_extensions_import(...).doit().await
let r = hub.projects().locations_reasoning_engines_operations_get(...).doit().await
let r = hub.projects().locations_reasoning_engines_operations_wait(...).doit().await
let r = hub.projects().locations_reasoning_engines_delete(...).doit().await
let r = hub.projects().locations_reasoning_engines_create(...).doit().await
let r = hub.projects().locations_reasoning_engines_patch(...).doit().await
let r = hub.projects().locations_pipeline_jobs_operations_wait(...).doit().await
let r = hub.projects().locations_pipeline_jobs_operations_get(...).doit().await
let r = hub.projects().locations_pipeline_jobs_delete(...).doit().await
let r = hub.projects().locations_pipeline_jobs_batch_delete(...).doit().await
let r = hub.projects().locations_pipeline_jobs_batch_cancel(...).doit().await
let r = hub.projects().locations_featurestores_entity_types_operations_wait(...).doit().await
let r = hub.projects().locations_featurestores_entity_types_operations_get(...).doit().await
let r = hub.projects().locations_featurestores_entity_types_features_operations_wait(...).doit().await
let r = hub.projects().locations_featurestores_entity_types_features_operations_get(...).doit().await
let r = hub.projects().locations_featurestores_entity_types_features_batch_create(...).doit().await
let r = hub.projects().locations_featurestores_entity_types_features_delete(...).doit().await
let r = hub.projects().locations_featurestores_entity_types_features_create(...).doit().await
let r = hub.projects().locations_featurestores_entity_types_delete_feature_values(...).doit().await
let r = hub.projects().locations_featurestores_entity_types_import_feature_values(...).doit().await
let r = hub.projects().locations_featurestores_entity_types_create(...).doit().await
let r = hub.projects().locations_featurestores_entity_types_export_feature_values(...).doit().await
let r = hub.projects().locations_featurestores_entity_types_delete(...).doit().await
let r = hub.projects().locations_featurestores_operations_get(...).doit().await
let r = hub.projects().locations_featurestores_operations_wait(...).doit().await
let r = hub.projects().locations_featurestores_batch_read_feature_values(...).doit().await
let r = hub.projects().locations_featurestores_delete(...).doit().await
let r = hub.projects().locations_featurestores_patch(...).doit().await
let r = hub.projects().locations_featurestores_create(...).doit().await
let r = hub.projects().locations_evaluation_tasks_operations_wait(...).doit().await
let r = hub.projects().locations_evaluation_tasks_operations_get(...).doit().await
let r = hub.projects().locations_data_labeling_jobs_operations_get(...).doit().await
let r = hub.projects().locations_data_labeling_jobs_operations_wait(...).doit().await
let r = hub.projects().locations_data_labeling_jobs_delete(...).doit().await
let r = hub.projects().locations_extension_controllers_operations_wait(...).doit().await
let r = hub.projects().locations_extension_controllers_operations_get(...).doit().await
let r = hub.projects().locations_operations_get(...).doit().await
let r = hub.projects().locations_operations_wait(...).doit().await
let r = hub.projects().locations_indexes_operations_get(...).doit().await
let r = hub.projects().locations_indexes_operations_wait(...).doit().await
let r = hub.projects().locations_indexes_delete(...).doit().await
let r = hub.projects().locations_indexes_patch(...).doit().await
let r = hub.projects().locations_indexes_create(...).doit().await
let r = hub.projects().locations_migratable_resources_operations_get(...).doit().await
let r = hub.projects().locations_migratable_resources_operations_wait(...).doit().await
let r = hub.projects().locations_migratable_resources_batch_migrate(...).doit().await
let r = hub.projects().locations_feature_groups_operations_wait(...).doit().await
let r = hub.projects().locations_feature_groups_operations_get(...).doit().await
let r = hub.projects().locations_feature_groups_features_operations_get(...).doit().await
let r = hub.projects().locations_feature_groups_features_operations_wait(...).doit().await
let r = hub.projects().locations_feature_groups_features_create(...).doit().await
let r = hub.projects().locations_feature_groups_features_delete(...).doit().await
let r = hub.projects().locations_feature_groups_features_patch(...).doit().await
let r = hub.projects().locations_feature_groups_delete(...).doit().await
let r = hub.projects().locations_feature_groups_create(...).doit().await
let r = hub.projects().locations_feature_groups_patch(...).doit().await
let r = hub.projects().locations_solvers_operations_get(...).doit().await
let r = hub.projects().locations_custom_jobs_operations_wait(...).doit().await
let r = hub.projects().locations_custom_jobs_operations_get(...).doit().await
let r = hub.projects().locations_custom_jobs_delete(...).doit().await
let r = hub.projects().locations_index_endpoints_operations_wait(...).doit().await
let r = hub.projects().locations_index_endpoints_operations_get(...).doit().await
let r = hub.projects().locations_index_endpoints_mutate_deployed_index(...).doit().await
let r = hub.projects().locations_index_endpoints_create(...).doit().await
let r = hub.projects().locations_index_endpoints_delete(...).doit().await
let r = hub.projects().locations_index_endpoints_deploy_index(...).doit().await
let r = hub.projects().locations_index_endpoints_undeploy_index(...).doit().await
let r = hub.projects().locations_specialist_pools_operations_get(...).doit().await
let r = hub.projects().locations_specialist_pools_operations_wait(...).doit().await
let r = hub.projects().locations_specialist_pools_delete(...).doit().await
let r = hub.projects().locations_specialist_pools_create(...).doit().await
let r = hub.projects().locations_specialist_pools_patch(...).doit().await
let r = hub.projects().locations_rag_corpora_operations_get(...).doit().await
let r = hub.projects().locations_rag_corpora_operations_wait(...).doit().await
let r = hub.projects().locations_rag_corpora_rag_files_operations_get(...).doit().await
let r = hub.projects().locations_rag_corpora_rag_files_operations_wait(...).doit().await
let r = hub.projects().locations_rag_corpora_rag_files_delete(...).doit().await
let r = hub.projects().locations_rag_corpora_rag_files_import(...).doit().await
let r = hub.projects().locations_rag_corpora_create(...).doit().await
let r = hub.projects().locations_rag_corpora_delete(...).doit().await
let r = hub.projects().locations_deployment_resource_pools_operations_wait(...).doit().await
let r = hub.projects().locations_deployment_resource_pools_operations_get(...).doit().await
let r = hub.projects().locations_deployment_resource_pools_patch(...).doit().await
let r = hub.projects().locations_deployment_resource_pools_create(...).doit().await
let r = hub.projects().locations_deployment_resource_pools_delete(...).doit().await
let r = hub.projects().locations_training_pipelines_operations_get(...).doit().await
let r = hub.projects().locations_training_pipelines_operations_wait(...).doit().await
let r = hub.projects().locations_training_pipelines_delete(...).doit().await
let r = hub.projects().locations_tensorboards_experiments_operations_get(...).doit().await
let r = hub.projects().locations_tensorboards_experiments_operations_wait(...).doit().await
let r = hub.projects().locations_tensorboards_experiments_runs_time_series_operations_get(...).doit().await
let r = hub.projects().locations_tensorboards_experiments_runs_time_series_operations_wait(...).doit().await
let r = hub.projects().locations_tensorboards_experiments_runs_time_series_delete(...).doit().await
let r = hub.projects().locations_tensorboards_experiments_runs_operations_get(...).doit().await
let r = hub.projects().locations_tensorboards_experiments_runs_operations_wait(...).doit().await
let r = hub.projects().locations_tensorboards_experiments_runs_delete(...).doit().await
let r = hub.projects().locations_tensorboards_experiments_delete(...).doit().await
let r = hub.projects().locations_tensorboards_operations_wait(...).doit().await
let r = hub.projects().locations_tensorboards_operations_get(...).doit().await
let r = hub.projects().locations_tensorboards_delete(...).doit().await
let r = hub.projects().locations_tensorboards_create(...).doit().await
let r = hub.projects().locations_tensorboards_patch(...).doit().await
let r = hub.projects().locations_agents_operations_get(...).doit().await
let r = hub.projects().locations_agents_operations_wait(...).doit().await
let r = hub.projects().locations_datasets_annotation_specs_operations_get(...).doit().await
let r = hub.projects().locations_datasets_annotation_specs_operations_wait(...).doit().await
let r = hub.projects().locations_datasets_data_items_annotations_operations_get(...).doit().await
let r = hub.projects().locations_datasets_data_items_annotations_operations_wait(...).doit().await
let r = hub.projects().locations_datasets_data_items_operations_wait(...).doit().await
let r = hub.projects().locations_datasets_data_items_operations_get(...).doit().await
let r = hub.projects().locations_datasets_saved_queries_operations_get(...).doit().await
let r = hub.projects().locations_datasets_saved_queries_operations_wait(...).doit().await
let r = hub.projects().locations_datasets_saved_queries_delete(...).doit().await
let r = hub.projects().locations_datasets_dataset_versions_delete(...).doit().await
let r = hub.projects().locations_datasets_dataset_versions_create(...).doit().await
let r = hub.projects().locations_datasets_dataset_versions_restore(...).doit().await
let r = hub.projects().locations_datasets_operations_get(...).doit().await
let r = hub.projects().locations_datasets_operations_wait(...).doit().await
let r = hub.projects().locations_datasets_create(...).doit().await
let r = hub.projects().locations_datasets_export(...).doit().await
let r = hub.projects().locations_datasets_import(...).doit().await
let r = hub.projects().locations_datasets_delete(...).doit().await
let r = hub.projects().locations_model_deployment_monitoring_jobs_operations_get(...).doit().await
let r = hub.projects().locations_model_deployment_monitoring_jobs_operations_wait(...).doit().await
let r = hub.projects().locations_model_deployment_monitoring_jobs_patch(...).doit().await
let r = hub.projects().locations_model_deployment_monitoring_jobs_delete(...).doit().await
let r = hub.projects().locations_feature_online_stores_feature_views_operations_wait(...).doit().await
let r = hub.projects().locations_feature_online_stores_feature_views_operations_get(...).doit().await
let r = hub.projects().locations_feature_online_stores_feature_views_create(...).doit().await
let r = hub.projects().locations_feature_online_stores_feature_views_patch(...).doit().await
let r = hub.projects().locations_feature_online_stores_feature_views_delete(...).doit().await
let r = hub.projects().locations_feature_online_stores_operations_wait(...).doit().await
let r = hub.projects().locations_feature_online_stores_operations_get(...).doit().await
let r = hub.projects().locations_feature_online_stores_create(...).doit().await
let r = hub.projects().locations_feature_online_stores_delete(...).doit().await
let r = hub.projects().locations_feature_online_stores_patch(...).doit().await
let r = hub.projects().locations_models_operations_wait(...).doit().await
let r = hub.projects().locations_models_operations_get(...).doit().await
let r = hub.projects().locations_models_evaluations_operations_wait(...).doit().await
let r = hub.projects().locations_models_evaluations_operations_get(...).doit().await
let r = hub.projects().locations_models_export(...).doit().await
let r = hub.projects().locations_models_upload(...).doit().await
let r = hub.projects().locations_models_update_explanation_dataset(...).doit().await
let r = hub.projects().locations_models_delete(...).doit().await
let r = hub.projects().locations_models_copy(...).doit().await
let r = hub.projects().locations_models_delete_version(...).doit().await
let r = hub.projects().locations_model_monitors_model_monitoring_jobs_delete(...).doit().await
let r = hub.projects().locations_model_monitors_operations_get(...).doit().await
let r = hub.projects().locations_model_monitors_operations_wait(...).doit().await
let r = hub.projects().locations_model_monitors_delete(...).doit().await
let r = hub.projects().locations_model_monitors_create(...).doit().await
let r = hub.projects().locations_model_monitors_patch(...).doit().await
let r = hub.projects().locations_example_stores_operations_get(...).doit().await
let r = hub.projects().locations_example_stores_operations_wait(...).doit().await
let r = hub.projects().locations_persistent_resources_operations_get(...).doit().await
let r = hub.projects().locations_persistent_resources_operations_wait(...).doit().await
let r = hub.projects().locations_persistent_resources_reboot(...).doit().await
let r = hub.projects().locations_persistent_resources_patch(...).doit().await
let r = hub.projects().locations_persistent_resources_create(...).doit().await
let r = hub.projects().locations_persistent_resources_delete(...).doit().await
let r = hub.projects().locations_notebook_execution_jobs_operations_get(...).doit().await
let r = hub.projects().locations_notebook_execution_jobs_operations_wait(...).doit().await
let r = hub.projects().locations_notebook_execution_jobs_delete(...).doit().await
let r = hub.projects().locations_notebook_execution_jobs_create(...).doit().await
let r = hub.projects().locations_studies_operations_get(...).doit().await
let r = hub.projects().locations_studies_operations_wait(...).doit().await
let r = hub.projects().locations_studies_trials_operations_get(...).doit().await
let r = hub.projects().locations_studies_trials_operations_wait(...).doit().await
let r = hub.projects().locations_studies_trials_suggest(...).doit().await
let r = hub.projects().locations_studies_trials_check_trial_early_stopping_state(...).doit().await
let r = hub.projects().locations_batch_prediction_jobs_delete(...).doit().await
let r = hub.projects().locations_metadata_stores_operations_get(...).doit().await
let r = hub.projects().locations_metadata_stores_operations_wait(...).doit().await
let r = hub.projects().locations_metadata_stores_contexts_operations_wait(...).doit().await
let r = hub.projects().locations_metadata_stores_contexts_operations_get(...).doit().await
let r = hub.projects().locations_metadata_stores_contexts_delete(...).doit().await
let r = hub.projects().locations_metadata_stores_contexts_purge(...).doit().await
let r = hub.projects().locations_metadata_stores_executions_operations_get(...).doit().await
let r = hub.projects().locations_metadata_stores_executions_operations_wait(...).doit().await
let r = hub.projects().locations_metadata_stores_executions_delete(...).doit().await
let r = hub.projects().locations_metadata_stores_executions_purge(...).doit().await
let r = hub.projects().locations_metadata_stores_artifacts_operations_wait(...).doit().await
let r = hub.projects().locations_metadata_stores_artifacts_operations_get(...).doit().await
let r = hub.projects().locations_metadata_stores_artifacts_purge(...).doit().await
let r = hub.projects().locations_metadata_stores_artifacts_delete(...).doit().await
let r = hub.projects().locations_metadata_stores_create(...).doit().await
let r = hub.projects().locations_metadata_stores_delete(...).doit().await
let r = hub.projects().update_cache_config(...).doit().await

resource()activity(...) 调用创建构建器。第二个处理 Activities,支持各种方法来配置即将进行的操作(此处未展示)。它是这样设计的,即所有必需的参数必须立即指定(即 (...)),而所有可选的参数都可以按需构建doit() 方法执行与服务器实际通信并返回相应的结果。

用法

设置您的项目

要使用此库,您需要将以下行放入您的 Cargo.toml 文件中

[dependencies]
google-aiplatform1_beta1 = "*"
serde = "^1.0"
serde_json = "^1.0"

完整示例

extern crate hyper;
extern crate hyper_rustls;
extern crate google_aiplatform1_beta1 as aiplatform1_beta1;
use aiplatform1_beta1::api::GoogleCloudAiplatformV1beta1FeatureView;
use aiplatform1_beta1::{Result, Error};
use std::default::Default;
use aiplatform1_beta1::{Aiplatform, oauth2, hyper, hyper_rustls, chrono, FieldMask};

// Get an ApplicationSecret instance by some means. It contains the `client_id` and 
// `client_secret`, among other things.
let secret: oauth2::ApplicationSecret = Default::default();
// Instantiate the authenticator. It will choose a suitable authentication flow for you, 
// unless you replace  `None` with the desired Flow.
// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about 
// what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
// retrieve them from storage.
let auth = oauth2::InstalledFlowAuthenticator::builder(
        secret,
        oauth2::InstalledFlowReturnMethod::HTTPRedirect,
    ).build().await.unwrap();
let mut hub = Aiplatform::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
// As the method needs a request, you would usually fill it with the desired information
// into the respective structure. Some of the parts shown here might not be applicable !
// Values shown here are possibly random and not representative !
let mut req = GoogleCloudAiplatformV1beta1FeatureView::default();

// You can configure optional parameters by calling the respective setters at will, and
// execute the final call using `doit()`.
// Values shown here are possibly random and not representative !
let result = hub.projects().locations_feature_online_stores_feature_views_create(req, "parent")
             .run_sync_immediately(true)
             .feature_view_id("voluptua.")
             .doit().await;

match result {
    Err(e) => match e {
        // The Error enum provides details about what exactly happened.
        // You can also just use its `Debug`, `Display` or `Error` traits
         Error::HttpError(_)
        |Error::Io(_)
        |Error::MissingAPIKey
        |Error::MissingToken(_)
        |Error::Cancelled
        |Error::UploadSizeLimitExceeded(_, _)
        |Error::Failure(_)
        |Error::BadRequest(_)
        |Error::FieldClash(_)
        |Error::JsonDecodeError(_, _) => println!("{}", e),
    },
    Ok(res) => println!("Success: {:?}", res),
}

处理错误

系统产生的所有错误都作为 Result 枚举提供,作为 doit() 方法的返回值,或者作为可能的中继结果传递给 Hub DelegateAuthenticator Delegate

当代理处理错误或中继值时,它们可能会有机会指示系统重试。这使得系统对各种错误具有潜在的鲁棒性。

上传和下载

如果方法支持下载,响应体,它是 Result 的一部分,应由您读取以获取媒体。如果此方法还支持 Response Result,则默认返回该结果。您可以将其视为实际媒体元数据。要触发媒体下载,您必须通过此调用设置构建器:.param("alt", "media")

支持上传的方法可以使用最多 2 种不同的协议进行上传:简单可恢复。每种协议的独特性由定制的 doit(...) 方法表示,分别命名为 upload(...)upload_resumable(...)

自定义和回调

您可以通过在最终调用 doit() 之前向 Method Builder 提供一个 delegate 来更改 doit() 方法调用的方式。相应的方 法将被调用以提供进度信息,以及确定系统是否应该在失败时重试。

delegate trait 默认实现,允许您以最小的努力进行自定义。

服务器请求中的可选部分

本库提供的所有结构均设计为可通过json进行编码和解码。可选参数用于表示部分请求或响应是有效的。大多数可选参数是可识别的部分,通过名称标识,这些部分将被发送到服务器,以指示请求的设置部分或响应中所需的部分。

构建器参数

使用方法构建器,您可以通过重复调用其方法来准备一个操作调用。这些方法始终只接受一个参数,以下语句是正确的。

  • PODs通过复制传递
  • 字符串作为&str传递
  • 请求值被移动

参数将始终被复制或克隆到构建器中,以确保它们与原始生命周期独立。

Cargo功能

  • utoipa - 添加对utoipa的支持,并在所有类型上派生utoipa::ToSchema。您必须将所需类型导入并注册到#[openapi(schemas(...))]中,否则生成的openapi规范将是无效的。

许可证

aiplatform1_beta1库由Sebastian Thiel生成,并置于MIT许可证之下。您可以在存储库的许可证文件中阅读全文。

依赖项

~12–23MB
~345K SLoC