google_cloudresourcemanager3/
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 *Cloud Resource Manager* crate version *7.0.0+20251103*, where *20251103* is the exact revision of the *cloudresourcemanager:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *Cloud Resource Manager* *v3* API can be found at the
8//! [official documentation site](https://cloud.google.com/resource-manager).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/cloudresourcemanager3).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](CloudResourceManager) ...
13//!
14//! * [effective tags](api::EffectiveTag)
15//!  * [*list*](api::EffectiveTagListCall)
16//! * [folders](api::Folder)
17//!  * [*capabilities get*](api::FolderCapabilityGetCall), [*capabilities patch*](api::FolderCapabilityPatchCall), [*create*](api::FolderCreateCall), [*delete*](api::FolderDeleteCall), [*get*](api::FolderGetCall), [*get iam policy*](api::FolderGetIamPolicyCall), [*list*](api::FolderListCall), [*move*](api::FolderMoveCall), [*patch*](api::FolderPatchCall), [*search*](api::FolderSearchCall), [*set iam policy*](api::FolderSetIamPolicyCall), [*test iam permissions*](api::FolderTestIamPermissionCall) and [*undelete*](api::FolderUndeleteCall)
18//! * [liens](api::Lien)
19//!  * [*create*](api::LienCreateCall), [*delete*](api::LienDeleteCall), [*get*](api::LienGetCall) and [*list*](api::LienListCall)
20//! * locations
21//!  * [*effective tag binding collections get*](api::LocationEffectiveTagBindingCollectionGetCall), [*tag binding collections get*](api::LocationTagBindingCollectionGetCall) and [*tag binding collections patch*](api::LocationTagBindingCollectionPatchCall)
22//! * [operations](api::Operation)
23//!  * [*get*](api::OperationGetCall)
24//! * [organizations](api::Organization)
25//!  * [*get*](api::OrganizationGetCall), [*get iam policy*](api::OrganizationGetIamPolicyCall), [*search*](api::OrganizationSearchCall), [*set iam policy*](api::OrganizationSetIamPolicyCall) and [*test iam permissions*](api::OrganizationTestIamPermissionCall)
26//! * [projects](api::Project)
27//!  * [*create*](api::ProjectCreateCall), [*delete*](api::ProjectDeleteCall), [*get*](api::ProjectGetCall), [*get iam policy*](api::ProjectGetIamPolicyCall), [*list*](api::ProjectListCall), [*move*](api::ProjectMoveCall), [*patch*](api::ProjectPatchCall), [*search*](api::ProjectSearchCall), [*set iam policy*](api::ProjectSetIamPolicyCall), [*test iam permissions*](api::ProjectTestIamPermissionCall) and [*undelete*](api::ProjectUndeleteCall)
28//! * [tag bindings](api::TagBinding)
29//!  * [*create*](api::TagBindingCreateCall), [*delete*](api::TagBindingDeleteCall) and [*list*](api::TagBindingListCall)
30//! * [tag keys](api::TagKey)
31//!  * [*create*](api::TagKeyCreateCall), [*delete*](api::TagKeyDeleteCall), [*get*](api::TagKeyGetCall), [*get iam policy*](api::TagKeyGetIamPolicyCall), [*get namespaced*](api::TagKeyGetNamespacedCall), [*list*](api::TagKeyListCall), [*patch*](api::TagKeyPatchCall), [*set iam policy*](api::TagKeySetIamPolicyCall) and [*test iam permissions*](api::TagKeyTestIamPermissionCall)
32//! * [tag values](api::TagValue)
33//!  * [*create*](api::TagValueCreateCall), [*delete*](api::TagValueDeleteCall), [*get*](api::TagValueGetCall), [*get iam policy*](api::TagValueGetIamPolicyCall), [*get namespaced*](api::TagValueGetNamespacedCall), [*list*](api::TagValueListCall), [*patch*](api::TagValuePatchCall), [*set iam policy*](api::TagValueSetIamPolicyCall), [*tag holds create*](api::TagValueTagHoldCreateCall), [*tag holds delete*](api::TagValueTagHoldDeleteCall), [*tag holds list*](api::TagValueTagHoldListCall) and [*test iam permissions*](api::TagValueTestIamPermissionCall)
34//!
35//!
36//!
37//!
38//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
39//!
40//! # Structure of this Library
41//!
42//! The API is structured into the following primary items:
43//!
44//! * **[Hub](CloudResourceManager)**
45//!     * a central object to maintain state and allow accessing all *Activities*
46//!     * creates [*Method Builders*](common::MethodsBuilder) which in turn
47//!       allow access to individual [*Call Builders*](common::CallBuilder)
48//! * **[Resources](common::Resource)**
49//!     * primary types that you can apply *Activities* to
50//!     * a collection of properties and *Parts*
51//!     * **[Parts](common::Part)**
52//!         * a collection of properties
53//!         * never directly used in *Activities*
54//! * **[Activities](common::CallBuilder)**
55//!     * operations to apply to *Resources*
56//!
57//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
58//!
59//! Generally speaking, you can invoke *Activities* like this:
60//!
61//! ```Rust,ignore
62//! let r = hub.resource().activity(...).doit().await
63//! ```
64//!
65//! Or specifically ...
66//!
67//! ```ignore
68//! let r = hub.folders().capabilities_patch(...).doit().await
69//! let r = hub.folders().create(...).doit().await
70//! let r = hub.folders().delete(...).doit().await
71//! let r = hub.folders().move_(...).doit().await
72//! let r = hub.folders().patch(...).doit().await
73//! let r = hub.folders().undelete(...).doit().await
74//! let r = hub.locations().tag_binding_collections_patch(...).doit().await
75//! let r = hub.operations().get(...).doit().await
76//! let r = hub.projects().create(...).doit().await
77//! let r = hub.projects().delete(...).doit().await
78//! let r = hub.projects().move_(...).doit().await
79//! let r = hub.projects().patch(...).doit().await
80//! let r = hub.projects().undelete(...).doit().await
81//! let r = hub.tag_bindings().create(...).doit().await
82//! let r = hub.tag_bindings().delete(...).doit().await
83//! let r = hub.tag_keys().create(...).doit().await
84//! let r = hub.tag_keys().delete(...).doit().await
85//! let r = hub.tag_keys().patch(...).doit().await
86//! let r = hub.tag_values().tag_holds_create(...).doit().await
87//! let r = hub.tag_values().tag_holds_delete(...).doit().await
88//! let r = hub.tag_values().create(...).doit().await
89//! let r = hub.tag_values().delete(...).doit().await
90//! let r = hub.tag_values().patch(...).doit().await
91//! ```
92//!
93//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
94//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
95//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
96//! The `doit()` method performs the actual communication with the server and returns the respective result.
97//!
98//! # Usage
99//!
100//! ## Setting up your Project
101//!
102//! To use this library, you would put the following lines into your `Cargo.toml` file:
103//!
104//! ```toml
105//! [dependencies]
106//! google-cloudresourcemanager3 = "*"
107//! serde = "1"
108//! serde_json = "1"
109//! ```
110//!
111//! ## A complete example
112//!
113//! ```test_harness,no_run
114//! extern crate hyper;
115//! extern crate hyper_rustls;
116//! extern crate google_cloudresourcemanager3 as cloudresourcemanager3;
117//! use cloudresourcemanager3::api::TagKey;
118//! use cloudresourcemanager3::{Result, Error};
119//! # async fn dox() {
120//! use cloudresourcemanager3::{CloudResourceManager, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
121//!
122//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
123//! // `client_secret`, among other things.
124//! let secret: yup_oauth2::ApplicationSecret = Default::default();
125//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
126//! // unless you replace  `None` with the desired Flow.
127//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
128//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
129//! // retrieve them from storage.
130//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
131//!     .with_native_roots()
132//!     .unwrap()
133//!     .https_only()
134//!     .enable_http2()
135//!     .build();
136//!
137//! let executor = hyper_util::rt::TokioExecutor::new();
138//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
139//!     secret,
140//!     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
141//!     yup_oauth2::client::CustomHyperClientBuilder::from(
142//!         hyper_util::client::legacy::Client::builder(executor).build(connector),
143//!     ),
144//! ).build().await.unwrap();
145//!
146//! let client = hyper_util::client::legacy::Client::builder(
147//!     hyper_util::rt::TokioExecutor::new()
148//! )
149//! .build(
150//!     hyper_rustls::HttpsConnectorBuilder::new()
151//!         .with_native_roots()
152//!         .unwrap()
153//!         .https_or_http()
154//!         .enable_http2()
155//!         .build()
156//! );
157//! let mut hub = CloudResourceManager::new(client, auth);
158//! // As the method needs a request, you would usually fill it with the desired information
159//! // into the respective structure. Some of the parts shown here might not be applicable !
160//! // Values shown here are possibly random and not representative !
161//! let mut req = TagKey::default();
162//!
163//! // You can configure optional parameters by calling the respective setters at will, and
164//! // execute the final call using `doit()`.
165//! // Values shown here are possibly random and not representative !
166//! let result = hub.tag_keys().patch(req, "name")
167//!              .validate_only(false)
168//!              .update_mask(FieldMask::new::<&str>(&[]))
169//!              .doit().await;
170//!
171//! match result {
172//!     Err(e) => match e {
173//!         // The Error enum provides details about what exactly happened.
174//!         // You can also just use its `Debug`, `Display` or `Error` traits
175//!          Error::HttpError(_)
176//!         |Error::Io(_)
177//!         |Error::MissingAPIKey
178//!         |Error::MissingToken(_)
179//!         |Error::Cancelled
180//!         |Error::UploadSizeLimitExceeded(_, _)
181//!         |Error::Failure(_)
182//!         |Error::BadRequest(_)
183//!         |Error::FieldClash(_)
184//!         |Error::JsonDecodeError(_, _) => println!("{}", e),
185//!     },
186//!     Ok(res) => println!("Success: {:?}", res),
187//! }
188//! # }
189//! ```
190//! ## Handling Errors
191//!
192//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
193//! the doit() methods, or handed as possibly intermediate results to either the
194//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
195//!
196//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
197//! makes the system potentially resilient to all kinds of errors.
198//!
199//! ## Uploads and Downloads
200//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
201//! read by you to obtain the media.
202//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
203//! 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
204//! this call: `.param("alt", "media")`.
205//!
206//! Methods supporting uploads can do so using up to 2 different protocols:
207//! *simple* and *resumable*. The distinctiveness of each is represented by customized
208//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
209//!
210//! ## Customization and Callbacks
211//!
212//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
213//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
214//! Respective methods will be called to provide progress information, as well as determine whether the system should
215//! retry on failure.
216//!
217//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
218//!
219//! ## Optional Parts in Server-Requests
220//!
221//! All structures provided by this library are made to be [encodable](common::RequestValue) and
222//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
223//! are valid.
224//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
225//! the server to indicate either the set parts of the request or the desired parts in the response.
226//!
227//! ## Builder Arguments
228//!
229//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
230//! These will always take a single argument, for which the following statements are true.
231//!
232//! * [PODs][wiki-pod] are handed by copy
233//! * strings are passed as `&str`
234//! * [request values](common::RequestValue) are moved
235//!
236//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
237//!
238//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
239//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
240//! [google-go-api]: https://github.com/google/google-api-go-client
241//!
242//! ## Cargo Features
243//!
244//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
245//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
246//! generated `openapi` spec would be invalid.
247//!
248//!
249//!
250
251// Unused attributes happen thanks to defined, but unused structures We don't
252// warn about this, as depending on the API, some data structures or facilities
253// are never used. Instead of pre-determining this, we just disable the lint.
254// It's manually tuned to not have any unused imports in fully featured APIs.
255// Same with unused_mut.
256#![allow(unused_imports, unused_mut, dead_code)]
257
258// DO NOT EDIT !
259// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
260// DO NOT EDIT !
261
262pub extern crate hyper;
263pub extern crate hyper_rustls;
264pub extern crate hyper_util;
265#[cfg(feature = "yup-oauth2")]
266pub extern crate yup_oauth2;
267
268pub extern crate google_apis_common as common;
269pub use common::{Delegate, Error, FieldMask, Result};
270
271pub mod api;
272pub use api::CloudResourceManager;