google_dlp2/
lib.rs

1// DO NOT EDIT !
2// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
3// DO NOT EDIT !
4
5//! This documentation was generated from *DLP* crate version *7.0.0+20251213*, where *20251213* is the exact revision of the *dlp:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *DLP* *v2* API can be found at the
8//! [official documentation site](https://cloud.google.com/sensitive-data-protection/docs/).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/dlp2).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](DLP) ...
13//!
14//! * info types
15//!  * [*list*](api::InfoTypeListCall)
16//! * locations
17//!  * [*info types list*](api::LocationInfoTypeListCall)
18//! * organizations
19//!  * [*deidentify templates create*](api::OrganizationDeidentifyTemplateCreateCall), [*deidentify templates delete*](api::OrganizationDeidentifyTemplateDeleteCall), [*deidentify templates get*](api::OrganizationDeidentifyTemplateGetCall), [*deidentify templates list*](api::OrganizationDeidentifyTemplateListCall), [*deidentify templates patch*](api::OrganizationDeidentifyTemplatePatchCall), [*inspect templates create*](api::OrganizationInspectTemplateCreateCall), [*inspect templates delete*](api::OrganizationInspectTemplateDeleteCall), [*inspect templates get*](api::OrganizationInspectTemplateGetCall), [*inspect templates list*](api::OrganizationInspectTemplateListCall), [*inspect templates patch*](api::OrganizationInspectTemplatePatchCall), [*locations column data profiles get*](api::OrganizationLocationColumnDataProfileGetCall), [*locations column data profiles list*](api::OrganizationLocationColumnDataProfileListCall), [*locations connections create*](api::OrganizationLocationConnectionCreateCall), [*locations connections delete*](api::OrganizationLocationConnectionDeleteCall), [*locations connections get*](api::OrganizationLocationConnectionGetCall), [*locations connections list*](api::OrganizationLocationConnectionListCall), [*locations connections patch*](api::OrganizationLocationConnectionPatchCall), [*locations connections search*](api::OrganizationLocationConnectionSearchCall), [*locations deidentify templates create*](api::OrganizationLocationDeidentifyTemplateCreateCall), [*locations deidentify templates delete*](api::OrganizationLocationDeidentifyTemplateDeleteCall), [*locations deidentify templates get*](api::OrganizationLocationDeidentifyTemplateGetCall), [*locations deidentify templates list*](api::OrganizationLocationDeidentifyTemplateListCall), [*locations deidentify templates patch*](api::OrganizationLocationDeidentifyTemplatePatchCall), [*locations discovery configs create*](api::OrganizationLocationDiscoveryConfigCreateCall), [*locations discovery configs delete*](api::OrganizationLocationDiscoveryConfigDeleteCall), [*locations discovery configs get*](api::OrganizationLocationDiscoveryConfigGetCall), [*locations discovery configs list*](api::OrganizationLocationDiscoveryConfigListCall), [*locations discovery configs patch*](api::OrganizationLocationDiscoveryConfigPatchCall), [*locations dlp jobs list*](api::OrganizationLocationDlpJobListCall), [*locations file store data profiles delete*](api::OrganizationLocationFileStoreDataProfileDeleteCall), [*locations file store data profiles get*](api::OrganizationLocationFileStoreDataProfileGetCall), [*locations file store data profiles list*](api::OrganizationLocationFileStoreDataProfileListCall), [*locations info types list*](api::OrganizationLocationInfoTypeListCall), [*locations inspect templates create*](api::OrganizationLocationInspectTemplateCreateCall), [*locations inspect templates delete*](api::OrganizationLocationInspectTemplateDeleteCall), [*locations inspect templates get*](api::OrganizationLocationInspectTemplateGetCall), [*locations inspect templates list*](api::OrganizationLocationInspectTemplateListCall), [*locations inspect templates patch*](api::OrganizationLocationInspectTemplatePatchCall), [*locations job triggers create*](api::OrganizationLocationJobTriggerCreateCall), [*locations job triggers delete*](api::OrganizationLocationJobTriggerDeleteCall), [*locations job triggers get*](api::OrganizationLocationJobTriggerGetCall), [*locations job triggers list*](api::OrganizationLocationJobTriggerListCall), [*locations job triggers patch*](api::OrganizationLocationJobTriggerPatchCall), [*locations project data profiles get*](api::OrganizationLocationProjectDataProfileGetCall), [*locations project data profiles list*](api::OrganizationLocationProjectDataProfileListCall), [*locations stored info types create*](api::OrganizationLocationStoredInfoTypeCreateCall), [*locations stored info types delete*](api::OrganizationLocationStoredInfoTypeDeleteCall), [*locations stored info types get*](api::OrganizationLocationStoredInfoTypeGetCall), [*locations stored info types list*](api::OrganizationLocationStoredInfoTypeListCall), [*locations stored info types patch*](api::OrganizationLocationStoredInfoTypePatchCall), [*locations table data profiles delete*](api::OrganizationLocationTableDataProfileDeleteCall), [*locations table data profiles get*](api::OrganizationLocationTableDataProfileGetCall), [*locations table data profiles list*](api::OrganizationLocationTableDataProfileListCall), [*stored info types create*](api::OrganizationStoredInfoTypeCreateCall), [*stored info types delete*](api::OrganizationStoredInfoTypeDeleteCall), [*stored info types get*](api::OrganizationStoredInfoTypeGetCall), [*stored info types list*](api::OrganizationStoredInfoTypeListCall) and [*stored info types patch*](api::OrganizationStoredInfoTypePatchCall)
20//! * projects
21//!  * [*content deidentify*](api::ProjectContentDeidentifyCall), [*content inspect*](api::ProjectContentInspectCall), [*content reidentify*](api::ProjectContentReidentifyCall), [*deidentify templates create*](api::ProjectDeidentifyTemplateCreateCall), [*deidentify templates delete*](api::ProjectDeidentifyTemplateDeleteCall), [*deidentify templates get*](api::ProjectDeidentifyTemplateGetCall), [*deidentify templates list*](api::ProjectDeidentifyTemplateListCall), [*deidentify templates patch*](api::ProjectDeidentifyTemplatePatchCall), [*dlp jobs cancel*](api::ProjectDlpJobCancelCall), [*dlp jobs create*](api::ProjectDlpJobCreateCall), [*dlp jobs delete*](api::ProjectDlpJobDeleteCall), [*dlp jobs get*](api::ProjectDlpJobGetCall), [*dlp jobs list*](api::ProjectDlpJobListCall), [*image redact*](api::ProjectImageRedactCall), [*inspect templates create*](api::ProjectInspectTemplateCreateCall), [*inspect templates delete*](api::ProjectInspectTemplateDeleteCall), [*inspect templates get*](api::ProjectInspectTemplateGetCall), [*inspect templates list*](api::ProjectInspectTemplateListCall), [*inspect templates patch*](api::ProjectInspectTemplatePatchCall), [*job triggers activate*](api::ProjectJobTriggerActivateCall), [*job triggers create*](api::ProjectJobTriggerCreateCall), [*job triggers delete*](api::ProjectJobTriggerDeleteCall), [*job triggers get*](api::ProjectJobTriggerGetCall), [*job triggers list*](api::ProjectJobTriggerListCall), [*job triggers patch*](api::ProjectJobTriggerPatchCall), [*locations column data profiles get*](api::ProjectLocationColumnDataProfileGetCall), [*locations column data profiles list*](api::ProjectLocationColumnDataProfileListCall), [*locations connections create*](api::ProjectLocationConnectionCreateCall), [*locations connections delete*](api::ProjectLocationConnectionDeleteCall), [*locations connections get*](api::ProjectLocationConnectionGetCall), [*locations connections list*](api::ProjectLocationConnectionListCall), [*locations connections patch*](api::ProjectLocationConnectionPatchCall), [*locations connections search*](api::ProjectLocationConnectionSearchCall), [*locations content deidentify*](api::ProjectLocationContentDeidentifyCall), [*locations content inspect*](api::ProjectLocationContentInspectCall), [*locations content reidentify*](api::ProjectLocationContentReidentifyCall), [*locations deidentify templates create*](api::ProjectLocationDeidentifyTemplateCreateCall), [*locations deidentify templates delete*](api::ProjectLocationDeidentifyTemplateDeleteCall), [*locations deidentify templates get*](api::ProjectLocationDeidentifyTemplateGetCall), [*locations deidentify templates list*](api::ProjectLocationDeidentifyTemplateListCall), [*locations deidentify templates patch*](api::ProjectLocationDeidentifyTemplatePatchCall), [*locations discovery configs create*](api::ProjectLocationDiscoveryConfigCreateCall), [*locations discovery configs delete*](api::ProjectLocationDiscoveryConfigDeleteCall), [*locations discovery configs get*](api::ProjectLocationDiscoveryConfigGetCall), [*locations discovery configs list*](api::ProjectLocationDiscoveryConfigListCall), [*locations discovery configs patch*](api::ProjectLocationDiscoveryConfigPatchCall), [*locations dlp jobs cancel*](api::ProjectLocationDlpJobCancelCall), [*locations dlp jobs create*](api::ProjectLocationDlpJobCreateCall), [*locations dlp jobs delete*](api::ProjectLocationDlpJobDeleteCall), [*locations dlp jobs finish*](api::ProjectLocationDlpJobFinishCall), [*locations dlp jobs get*](api::ProjectLocationDlpJobGetCall), [*locations dlp jobs hybrid inspect*](api::ProjectLocationDlpJobHybridInspectCall), [*locations dlp jobs list*](api::ProjectLocationDlpJobListCall), [*locations file store data profiles delete*](api::ProjectLocationFileStoreDataProfileDeleteCall), [*locations file store data profiles get*](api::ProjectLocationFileStoreDataProfileGetCall), [*locations file store data profiles list*](api::ProjectLocationFileStoreDataProfileListCall), [*locations image redact*](api::ProjectLocationImageRedactCall), [*locations info types list*](api::ProjectLocationInfoTypeListCall), [*locations inspect templates create*](api::ProjectLocationInspectTemplateCreateCall), [*locations inspect templates delete*](api::ProjectLocationInspectTemplateDeleteCall), [*locations inspect templates get*](api::ProjectLocationInspectTemplateGetCall), [*locations inspect templates list*](api::ProjectLocationInspectTemplateListCall), [*locations inspect templates patch*](api::ProjectLocationInspectTemplatePatchCall), [*locations job triggers activate*](api::ProjectLocationJobTriggerActivateCall), [*locations job triggers create*](api::ProjectLocationJobTriggerCreateCall), [*locations job triggers delete*](api::ProjectLocationJobTriggerDeleteCall), [*locations job triggers get*](api::ProjectLocationJobTriggerGetCall), [*locations job triggers hybrid inspect*](api::ProjectLocationJobTriggerHybridInspectCall), [*locations job triggers list*](api::ProjectLocationJobTriggerListCall), [*locations job triggers patch*](api::ProjectLocationJobTriggerPatchCall), [*locations project data profiles get*](api::ProjectLocationProjectDataProfileGetCall), [*locations project data profiles list*](api::ProjectLocationProjectDataProfileListCall), [*locations stored info types create*](api::ProjectLocationStoredInfoTypeCreateCall), [*locations stored info types delete*](api::ProjectLocationStoredInfoTypeDeleteCall), [*locations stored info types get*](api::ProjectLocationStoredInfoTypeGetCall), [*locations stored info types list*](api::ProjectLocationStoredInfoTypeListCall), [*locations stored info types patch*](api::ProjectLocationStoredInfoTypePatchCall), [*locations table data profiles delete*](api::ProjectLocationTableDataProfileDeleteCall), [*locations table data profiles get*](api::ProjectLocationTableDataProfileGetCall), [*locations table data profiles list*](api::ProjectLocationTableDataProfileListCall), [*stored info types create*](api::ProjectStoredInfoTypeCreateCall), [*stored info types delete*](api::ProjectStoredInfoTypeDeleteCall), [*stored info types get*](api::ProjectStoredInfoTypeGetCall), [*stored info types list*](api::ProjectStoredInfoTypeListCall) and [*stored info types patch*](api::ProjectStoredInfoTypePatchCall)
22//!
23//!
24//!
25//!
26//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
27//!
28//! # Structure of this Library
29//!
30//! The API is structured into the following primary items:
31//!
32//! * **[Hub](DLP)**
33//!     * a central object to maintain state and allow accessing all *Activities*
34//!     * creates [*Method Builders*](common::MethodsBuilder) which in turn
35//!       allow access to individual [*Call Builders*](common::CallBuilder)
36//! * **[Resources](common::Resource)**
37//!     * primary types that you can apply *Activities* to
38//!     * a collection of properties and *Parts*
39//!     * **[Parts](common::Part)**
40//!         * a collection of properties
41//!         * never directly used in *Activities*
42//! * **[Activities](common::CallBuilder)**
43//!     * operations to apply to *Resources*
44//!
45//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
46//!
47//! Generally speaking, you can invoke *Activities* like this:
48//!
49//! ```Rust,ignore
50//! let r = hub.resource().activity(...).doit().await
51//! ```
52//!
53//! Or specifically ...
54//!
55//! ```ignore
56//! let r = hub.organizations().deidentify_templates_delete(...).doit().await
57//! let r = hub.organizations().inspect_templates_delete(...).doit().await
58//! let r = hub.organizations().locations_connections_delete(...).doit().await
59//! let r = hub.organizations().locations_deidentify_templates_delete(...).doit().await
60//! let r = hub.organizations().locations_discovery_configs_delete(...).doit().await
61//! let r = hub.organizations().locations_file_store_data_profiles_delete(...).doit().await
62//! let r = hub.organizations().locations_inspect_templates_delete(...).doit().await
63//! let r = hub.organizations().locations_job_triggers_delete(...).doit().await
64//! let r = hub.organizations().locations_stored_info_types_delete(...).doit().await
65//! let r = hub.organizations().locations_table_data_profiles_delete(...).doit().await
66//! let r = hub.organizations().stored_info_types_delete(...).doit().await
67//! let r = hub.projects().deidentify_templates_delete(...).doit().await
68//! let r = hub.projects().dlp_jobs_cancel(...).doit().await
69//! let r = hub.projects().dlp_jobs_delete(...).doit().await
70//! let r = hub.projects().inspect_templates_delete(...).doit().await
71//! let r = hub.projects().job_triggers_delete(...).doit().await
72//! let r = hub.projects().locations_connections_delete(...).doit().await
73//! let r = hub.projects().locations_deidentify_templates_delete(...).doit().await
74//! let r = hub.projects().locations_discovery_configs_delete(...).doit().await
75//! let r = hub.projects().locations_dlp_jobs_cancel(...).doit().await
76//! let r = hub.projects().locations_dlp_jobs_delete(...).doit().await
77//! let r = hub.projects().locations_dlp_jobs_finish(...).doit().await
78//! let r = hub.projects().locations_file_store_data_profiles_delete(...).doit().await
79//! let r = hub.projects().locations_inspect_templates_delete(...).doit().await
80//! let r = hub.projects().locations_job_triggers_delete(...).doit().await
81//! let r = hub.projects().locations_stored_info_types_delete(...).doit().await
82//! let r = hub.projects().locations_table_data_profiles_delete(...).doit().await
83//! let r = hub.projects().stored_info_types_delete(...).doit().await
84//! ```
85//!
86//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
87//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
88//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
89//! The `doit()` method performs the actual communication with the server and returns the respective result.
90//!
91//! # Usage
92//!
93//! ## Setting up your Project
94//!
95//! To use this library, you would put the following lines into your `Cargo.toml` file:
96//!
97//! ```toml
98//! [dependencies]
99//! google-dlp2 = "*"
100//! serde = "1"
101//! serde_json = "1"
102//! ```
103//!
104//! ## A complete example
105//!
106//! ```test_harness,no_run
107//! extern crate hyper;
108//! extern crate hyper_rustls;
109//! extern crate google_dlp2 as dlp2;
110//! use dlp2::api::GooglePrivacyDlpV2CancelDlpJobRequest;
111//! use dlp2::{Result, Error};
112//! # async fn dox() {
113//! use dlp2::{DLP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
114//!
115//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
116//! // `client_secret`, among other things.
117//! let secret: yup_oauth2::ApplicationSecret = Default::default();
118//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
119//! // unless you replace  `None` with the desired Flow.
120//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
121//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
122//! // retrieve them from storage.
123//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
124//!     .with_native_roots()
125//!     .unwrap()
126//!     .https_only()
127//!     .enable_http2()
128//!     .build();
129//!
130//! let executor = hyper_util::rt::TokioExecutor::new();
131//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
132//!     secret,
133//!     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
134//!     yup_oauth2::client::CustomHyperClientBuilder::from(
135//!         hyper_util::client::legacy::Client::builder(executor).build(connector),
136//!     ),
137//! ).build().await.unwrap();
138//!
139//! let client = hyper_util::client::legacy::Client::builder(
140//!     hyper_util::rt::TokioExecutor::new()
141//! )
142//! .build(
143//!     hyper_rustls::HttpsConnectorBuilder::new()
144//!         .with_native_roots()
145//!         .unwrap()
146//!         .https_or_http()
147//!         .enable_http2()
148//!         .build()
149//! );
150//! let mut hub = DLP::new(client, auth);
151//! // As the method needs a request, you would usually fill it with the desired information
152//! // into the respective structure. Some of the parts shown here might not be applicable !
153//! // Values shown here are possibly random and not representative !
154//! let mut req = GooglePrivacyDlpV2CancelDlpJobRequest::default();
155//!
156//! // You can configure optional parameters by calling the respective setters at will, and
157//! // execute the final call using `doit()`.
158//! // Values shown here are possibly random and not representative !
159//! let result = hub.projects().dlp_jobs_cancel(req, "name")
160//!              .doit().await;
161//!
162//! match result {
163//!     Err(e) => match e {
164//!         // The Error enum provides details about what exactly happened.
165//!         // You can also just use its `Debug`, `Display` or `Error` traits
166//!          Error::HttpError(_)
167//!         |Error::Io(_)
168//!         |Error::MissingAPIKey
169//!         |Error::MissingToken(_)
170//!         |Error::Cancelled
171//!         |Error::UploadSizeLimitExceeded(_, _)
172//!         |Error::Failure(_)
173//!         |Error::BadRequest(_)
174//!         |Error::FieldClash(_)
175//!         |Error::JsonDecodeError(_, _) => println!("{}", e),
176//!     },
177//!     Ok(res) => println!("Success: {:?}", res),
178//! }
179//! # }
180//! ```
181//! ## Handling Errors
182//!
183//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
184//! the doit() methods, or handed as possibly intermediate results to either the
185//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
186//!
187//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
188//! makes the system potentially resilient to all kinds of errors.
189//!
190//! ## Uploads and Downloads
191//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
192//! read by you to obtain the media.
193//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
194//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
195//! this call: `.param("alt", "media")`.
196//!
197//! Methods supporting uploads can do so using up to 2 different protocols:
198//! *simple* and *resumable*. The distinctiveness of each is represented by customized
199//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
200//!
201//! ## Customization and Callbacks
202//!
203//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
204//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
205//! Respective methods will be called to provide progress information, as well as determine whether the system should
206//! retry on failure.
207//!
208//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
209//!
210//! ## Optional Parts in Server-Requests
211//!
212//! All structures provided by this library are made to be [encodable](common::RequestValue) and
213//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
214//! are valid.
215//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
216//! the server to indicate either the set parts of the request or the desired parts in the response.
217//!
218//! ## Builder Arguments
219//!
220//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
221//! These will always take a single argument, for which the following statements are true.
222//!
223//! * [PODs][wiki-pod] are handed by copy
224//! * strings are passed as `&str`
225//! * [request values](common::RequestValue) are moved
226//!
227//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
228//!
229//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
230//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
231//! [google-go-api]: https://github.com/google/google-api-go-client
232//!
233//! ## Cargo Features
234//!
235//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
236//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
237//! generated `openapi` spec would be invalid.
238//!
239//!
240//!
241
242// Unused attributes happen thanks to defined, but unused structures We don't
243// warn about this, as depending on the API, some data structures or facilities
244// are never used. Instead of pre-determining this, we just disable the lint.
245// It's manually tuned to not have any unused imports in fully featured APIs.
246// Same with unused_mut.
247#![allow(unused_imports, unused_mut, dead_code)]
248
249// DO NOT EDIT !
250// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
251// DO NOT EDIT !
252
253pub extern crate hyper;
254pub extern crate hyper_rustls;
255pub extern crate hyper_util;
256#[cfg(feature = "yup-oauth2")]
257pub extern crate yup_oauth2;
258
259pub extern crate google_apis_common as common;
260pub use common::{Delegate, Error, FieldMask, Result};
261
262pub mod api;
263pub use api::DLP;