8 个版本 (稳定)
5.0.5+20240611 | 2024年6月27日 |
---|---|
5.0.4+20240224 | 2024年3月5日 |
5.0.3+20230120 | 2023年8月23日 |
5.0.2+20230120 | 2023年3月16日 |
3.0.0+20220223 | 2022年3月8日 |
#953 在 认证
2.5MB
30K SLoC
“google-dataplex1”库允许访问“Google Cloud Dataplex”服务的所有功能。
此文档是根据版本为 5.0.5+20240611 的“Cloud Dataplex”crate生成的,其中“20240611”是mako代码生成器构建的dataplex:v1模式的确切修订版本v5.0.5。
有关“Cloud Dataplex”v1 API的其他信息,请参阅官方文档网站。
功能
轻松从中心枢纽处理以下资源...
- 项目
- locations aspect types create, locations aspect types delete, locations aspect types get, locations aspect types get iam policy, locations aspect types list, locations aspect types patch, locations aspect types set iam policy, locations aspect types test iam permissions, locations data attribute bindings create, locations data attribute bindings delete, locations data attribute bindings get, locations data attribute bindings get iam policy, locations data attribute bindings list, locations data attribute bindings patch, locations data attribute bindings set iam policy, locations data attribute bindings test iam permissions, locations data scans create, locations data scans delete, locations data scans generate data quality rules, locations data scans get, locations data scans get iam policy, locations data scans jobs generate data quality rules, locations data scans jobs get, locations data scans jobs list, locations data scans list, locations data scans patch, locations data scans run, locations data scans set iam policy, locations data scans test iam permissions, locations data taxonomies attributes create, locations data taxonomies attributes delete, locations data taxonomies attributes get, locations data taxonomies attributes get iam policy, locations data taxonomies attributes list, locations data taxonomies attributes patch, locations data taxonomies attributes set iam policy, locations data taxonomies attributes test iam permissions, locations data taxonomies create, locations data taxonomies delete, locations data taxonomies get, locations data taxonomies get iam policy, locations data taxonomies list, locations data taxonomies patch, locations data taxonomies set iam policy, locations data taxonomies test iam permissions, locations entry groups create, locations entry groups delete, locations entry groups entries create, locations entry groups entries delete, locations entry groups entries get, locations entry groups entries list, locations entry groups entries patch, locations entry groups get, locations entry groups get iam policy, locations entry groups list, locations entry groups patch, locations entry groups set iam policy, locations entry groups test iam permissions, locations entry types create, locations entry types delete, locations entry types get, locations entry types get iam policy, locations entry types list, locations entry types patch, locations entry types set iam policy, locations entry types test iam permissions, locations get, locations governance rules get iam policy, locations governance rules set iam policy, locations governance rules test iam permissions, locations lakes actions list, locations lakes content create, locations lakes content delete, locations lakes content get, locations lakes content get iam policy, locations lakes content list, locations lakes content patch, locations lakes content set iam policy, locations lakes content test iam permissions, locations lakes contentitems create, locations lakes contentitems delete, locations lakes contentitems get, locations lakes contentitems get iam policy, locations lakes contentitems list, locations lakes contentitems patch, locations lakes contentitems set iam policy, locations lakes contentitems test iam permissions, locations lakes create, locations lakes delete, locations lakes environments create, locations lakes environments delete, locations lakes environments get, locations lakes environments get iam policy, locations lakes environments list, locations lakes environments patch, locations lakes environments sessions list, locations lakes environments set iam policy, locations lakes environments test iam permissions, locations lakes get, locations lakes get iam policy, locations lakes list, locations lakes patch, locations lakes set iam policy, locations lakes tasks create, locations lakes tasks delete, locations lakes tasks get, locations lakes tasks get iam policy, locations lakes tasks jobs cancel, locations lakes tasks jobs get, locations lakes tasks jobs list, locations lakes tasks list, locations lakes tasks patch, locations lakes tasks run, locations lakes tasks set iam policy, locations lakes tasks test iam permissions, locations lakes test iam permissions, locations lakes zones actions list, locations lakes zones assets actions list, locations lakes zones assets create, locations lakes zones assets delete, locations lakes zones assets get, locations lakes zones assets get iam policy, locations lakes zones assets list, locations lakes zones assets patch, locations lakes zones assets set iam policy, locations lakes zones assets test iam permissions, locations lakes zones create, locations lakes zones delete, locations lakes zones entities create, locations lakes zones entities delete, locations lakes zones entities get, locations lakes zones entities list, locations lakes zones entities partitions create, locations lakes zones entities partitions delete, locations lakes zones entities partitions get, locations lakes zones entities partitions list, locations lakes zones entities update, locations lakes zones get, locations lakes zones get iam policy, locations lakes zones list, locations lakes zones patch, locations lakes zones set iam policy, locations lakes zones test iam permissions, locations list, locations lookup entry, locations operations cancel, locations operations delete, locations operations get, locations operations list and locations search entries
本库的结构
API分为以下主要项目
所有结构都标记了适用的特性,以便进一步分类并方便浏览。
一般来说,您可以像这样调用活动
let r = hub.resource().activity(...).doit().await
或者具体...
let r = hub.projects().locations_aspect_types_create(...).doit().await
let r = hub.projects().locations_aspect_types_delete(...).doit().await
let r = hub.projects().locations_aspect_types_patch(...).doit().await
let r = hub.projects().locations_data_attribute_bindings_create(...).doit().await
let r = hub.projects().locations_data_attribute_bindings_delete(...).doit().await
let r = hub.projects().locations_data_attribute_bindings_patch(...).doit().await
let r = hub.projects().locations_data_scans_create(...).doit().await
let r = hub.projects().locations_data_scans_delete(...).doit().await
let r = hub.projects().locations_data_scans_patch(...).doit().await
let r = hub.projects().locations_data_taxonomies_attributes_create(...).doit().await
let r = hub.projects().locations_data_taxonomies_attributes_delete(...).doit().await
let r = hub.projects().locations_data_taxonomies_attributes_patch(...).doit().await
let r = hub.projects().locations_data_taxonomies_create(...).doit().await
let r = hub.projects().locations_data_taxonomies_delete(...).doit().await
let r = hub.projects().locations_data_taxonomies_patch(...).doit().await
let r = hub.projects().locations_entry_groups_create(...).doit().await
let r = hub.projects().locations_entry_groups_delete(...).doit().await
let r = hub.projects().locations_entry_groups_patch(...).doit().await
let r = hub.projects().locations_entry_types_create(...).doit().await
let r = hub.projects().locations_entry_types_delete(...).doit().await
let r = hub.projects().locations_entry_types_patch(...).doit().await
let r = hub.projects().locations_lakes_environments_create(...).doit().await
let r = hub.projects().locations_lakes_environments_delete(...).doit().await
let r = hub.projects().locations_lakes_environments_patch(...).doit().await
let r = hub.projects().locations_lakes_tasks_create(...).doit().await
let r = hub.projects().locations_lakes_tasks_delete(...).doit().await
let r = hub.projects().locations_lakes_tasks_patch(...).doit().await
let r = hub.projects().locations_lakes_zones_assets_create(...).doit().await
let r = hub.projects().locations_lakes_zones_assets_delete(...).doit().await
let r = hub.projects().locations_lakes_zones_assets_patch(...).doit().await
let r = hub.projects().locations_lakes_zones_create(...).doit().await
let r = hub.projects().locations_lakes_zones_delete(...).doit().await
let r = hub.projects().locations_lakes_zones_patch(...).doit().await
let r = hub.projects().locations_lakes_create(...).doit().await
let r = hub.projects().locations_lakes_delete(...).doit().await
let r = hub.projects().locations_lakes_patch(...).doit().await
let r = hub.projects().locations_operations_get(...).doit().await
《资源》和《活动》调用创建了建造者模式。第二个调用处理《活动》并支持多种配置即将进行的操作的方法(此处未展示)。它被设计成所有必需的参数必须立即指定(即(...)
),而所有可选的参数可以按需构建。`doit()`方法执行与服务器实际的通信并返回相应的结果。
用法
设置您的项目
要使用此库,您需要在您的Cargo.toml
文件中添加以下行
[dependencies]
google-dataplex1 = "*"
serde = "^1.0"
serde_json = "^1.0"
完整示例
extern crate hyper;
extern crate hyper_rustls;
extern crate google_dataplex1 as dataplex1;
use dataplex1::api::GoogleCloudDataplexV1AspectType;
use dataplex1::{Result, Error};
use std::default::Default;
use dataplex1::{CloudDataplex, 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 = CloudDataplex::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 = GoogleCloudDataplexV1AspectType::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_aspect_types_create(req, "parent")
.validate_only(true)
.aspect_type_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 Delegate,或Authenticator Delegate。
当代理处理错误或中间值时,它们有机会指示系统重试。这使得系统可能对所有类型的错误具有弹性。
上传和下载
如果方法支持下载,响应体(它是Result的一部分)应由您读取以获取媒体。如果此类方法还支持Response Result,则默认返回该值。您可以将其视为实际媒体元数据。要触发媒体下载,您将需要通过此调用设置建造者:.param("alt", "media")
。
支持上传的方法可以使用最多两种不同的协议进行上传:`简单`和`可恢复`。每种协议的独特性由定制的`doit()`方法表示,分别命名为`upload()`和`upload_resumable()`。
自定义和回调
您可以通过在最终调用`doit()`之前向方法建造者提供一个代理来修改`doit()`方法的调用方式。相应的方法将被调用以提供进度信息,并确定系统在失败时是否应该重试。
该 代理特质 默认实现,让您可以轻松自定义。
服务器请求中的可选部分
本库提供的所有结构都是为了能够通过 json 进行 编码 和 解码。可选参数用于表示部分请求和响应是有效的。大多数可选参数被视为 部分,通过名称可识别,这些部分将被发送到服务器,以指示请求中设置的参数或期望的响应参数。
构建器参数
通过使用 方法构建器,您可以通过重复调用其方法来准备一个动作调用。这些方法总是接受单个参数,以下语句对它成立。
参数总是被复制或克隆到构建器中,以确保它们与其原始生命周期独立。
Cargo 功能
utoipa
- 添加对 utoipa 的支持,并派生所有类型的utoipa::ToSchema
。您必须将所需类型导入并注册到#[openapi(schemas(...))]
,否则生成的openapi
规范将无效。
许可证
dataplex1 库由 Sebastian Thiel 生成,并置于 MIT 许可证下。您可以在存储库的 许可证文件 中阅读全文。
依赖项
~12–23MB
~343K SLoC