google_privateca1/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 *Certificate Authority Service* crate version *7.0.0+20251022*, where *20251022* is the exact revision of the *privateca:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *Certificate Authority Service* *v1* API can be found at the
8//! [official documentation site](https://cloud.google.com/).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/privateca1).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](CertificateAuthorityService) ...
13//!
14//! * projects
15//! * [*locations ca pools certificate authorities activate*](api::ProjectLocationCaPoolCertificateAuthorityActivateCall), [*locations ca pools certificate authorities certificate revocation lists get*](api::ProjectLocationCaPoolCertificateAuthorityCertificateRevocationListGetCall), [*locations ca pools certificate authorities certificate revocation lists get iam policy*](api::ProjectLocationCaPoolCertificateAuthorityCertificateRevocationListGetIamPolicyCall), [*locations ca pools certificate authorities certificate revocation lists list*](api::ProjectLocationCaPoolCertificateAuthorityCertificateRevocationListListCall), [*locations ca pools certificate authorities certificate revocation lists patch*](api::ProjectLocationCaPoolCertificateAuthorityCertificateRevocationListPatchCall), [*locations ca pools certificate authorities certificate revocation lists set iam policy*](api::ProjectLocationCaPoolCertificateAuthorityCertificateRevocationListSetIamPolicyCall), [*locations ca pools certificate authorities certificate revocation lists test iam permissions*](api::ProjectLocationCaPoolCertificateAuthorityCertificateRevocationListTestIamPermissionCall), [*locations ca pools certificate authorities create*](api::ProjectLocationCaPoolCertificateAuthorityCreateCall), [*locations ca pools certificate authorities delete*](api::ProjectLocationCaPoolCertificateAuthorityDeleteCall), [*locations ca pools certificate authorities disable*](api::ProjectLocationCaPoolCertificateAuthorityDisableCall), [*locations ca pools certificate authorities enable*](api::ProjectLocationCaPoolCertificateAuthorityEnableCall), [*locations ca pools certificate authorities fetch*](api::ProjectLocationCaPoolCertificateAuthorityFetchCall), [*locations ca pools certificate authorities get*](api::ProjectLocationCaPoolCertificateAuthorityGetCall), [*locations ca pools certificate authorities list*](api::ProjectLocationCaPoolCertificateAuthorityListCall), [*locations ca pools certificate authorities patch*](api::ProjectLocationCaPoolCertificateAuthorityPatchCall), [*locations ca pools certificate authorities undelete*](api::ProjectLocationCaPoolCertificateAuthorityUndeleteCall), [*locations ca pools certificates create*](api::ProjectLocationCaPoolCertificateCreateCall), [*locations ca pools certificates get*](api::ProjectLocationCaPoolCertificateGetCall), [*locations ca pools certificates list*](api::ProjectLocationCaPoolCertificateListCall), [*locations ca pools certificates patch*](api::ProjectLocationCaPoolCertificatePatchCall), [*locations ca pools certificates revoke*](api::ProjectLocationCaPoolCertificateRevokeCall), [*locations ca pools create*](api::ProjectLocationCaPoolCreateCall), [*locations ca pools delete*](api::ProjectLocationCaPoolDeleteCall), [*locations ca pools fetch ca certs*](api::ProjectLocationCaPoolFetchCaCertCall), [*locations ca pools get*](api::ProjectLocationCaPoolGetCall), [*locations ca pools get iam policy*](api::ProjectLocationCaPoolGetIamPolicyCall), [*locations ca pools list*](api::ProjectLocationCaPoolListCall), [*locations ca pools patch*](api::ProjectLocationCaPoolPatchCall), [*locations ca pools set iam policy*](api::ProjectLocationCaPoolSetIamPolicyCall), [*locations ca pools test iam permissions*](api::ProjectLocationCaPoolTestIamPermissionCall), [*locations certificate templates create*](api::ProjectLocationCertificateTemplateCreateCall), [*locations certificate templates delete*](api::ProjectLocationCertificateTemplateDeleteCall), [*locations certificate templates get*](api::ProjectLocationCertificateTemplateGetCall), [*locations certificate templates get iam policy*](api::ProjectLocationCertificateTemplateGetIamPolicyCall), [*locations certificate templates list*](api::ProjectLocationCertificateTemplateListCall), [*locations certificate templates patch*](api::ProjectLocationCertificateTemplatePatchCall), [*locations certificate templates set iam policy*](api::ProjectLocationCertificateTemplateSetIamPolicyCall), [*locations certificate templates test iam permissions*](api::ProjectLocationCertificateTemplateTestIamPermissionCall), [*locations get*](api::ProjectLocationGetCall), [*locations list*](api::ProjectLocationListCall), [*locations operations cancel*](api::ProjectLocationOperationCancelCall), [*locations operations delete*](api::ProjectLocationOperationDeleteCall), [*locations operations get*](api::ProjectLocationOperationGetCall) and [*locations operations list*](api::ProjectLocationOperationListCall)
16//!
17//!
18//!
19//!
20//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
21//!
22//! # Structure of this Library
23//!
24//! The API is structured into the following primary items:
25//!
26//! * **[Hub](CertificateAuthorityService)**
27//! * a central object to maintain state and allow accessing all *Activities*
28//! * creates [*Method Builders*](common::MethodsBuilder) which in turn
29//! allow access to individual [*Call Builders*](common::CallBuilder)
30//! * **[Resources](common::Resource)**
31//! * primary types that you can apply *Activities* to
32//! * a collection of properties and *Parts*
33//! * **[Parts](common::Part)**
34//! * a collection of properties
35//! * never directly used in *Activities*
36//! * **[Activities](common::CallBuilder)**
37//! * operations to apply to *Resources*
38//!
39//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
40//!
41//! Generally speaking, you can invoke *Activities* like this:
42//!
43//! ```Rust,ignore
44//! let r = hub.resource().activity(...).doit().await
45//! ```
46//!
47//! Or specifically ...
48//!
49//! ```ignore
50//! let r = hub.projects().locations_ca_pools_certificate_authorities_certificate_revocation_lists_patch(...).doit().await
51//! let r = hub.projects().locations_ca_pools_certificate_authorities_activate(...).doit().await
52//! let r = hub.projects().locations_ca_pools_certificate_authorities_create(...).doit().await
53//! let r = hub.projects().locations_ca_pools_certificate_authorities_delete(...).doit().await
54//! let r = hub.projects().locations_ca_pools_certificate_authorities_disable(...).doit().await
55//! let r = hub.projects().locations_ca_pools_certificate_authorities_enable(...).doit().await
56//! let r = hub.projects().locations_ca_pools_certificate_authorities_patch(...).doit().await
57//! let r = hub.projects().locations_ca_pools_certificate_authorities_undelete(...).doit().await
58//! let r = hub.projects().locations_ca_pools_create(...).doit().await
59//! let r = hub.projects().locations_ca_pools_delete(...).doit().await
60//! let r = hub.projects().locations_ca_pools_patch(...).doit().await
61//! let r = hub.projects().locations_certificate_templates_create(...).doit().await
62//! let r = hub.projects().locations_certificate_templates_delete(...).doit().await
63//! let r = hub.projects().locations_certificate_templates_patch(...).doit().await
64//! let r = hub.projects().locations_operations_get(...).doit().await
65//! ```
66//!
67//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
68//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
69//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
70//! The `doit()` method performs the actual communication with the server and returns the respective result.
71//!
72//! # Usage
73//!
74//! ## Setting up your Project
75//!
76//! To use this library, you would put the following lines into your `Cargo.toml` file:
77//!
78//! ```toml
79//! [dependencies]
80//! google-privateca1 = "*"
81//! serde = "1"
82//! serde_json = "1"
83//! ```
84//!
85//! ## A complete example
86//!
87//! ```test_harness,no_run
88//! extern crate hyper;
89//! extern crate hyper_rustls;
90//! extern crate google_privateca1 as privateca1;
91//! use privateca1::{Result, Error};
92//! # async fn dox() {
93//! use privateca1::{CertificateAuthorityService, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
94//!
95//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
96//! // `client_secret`, among other things.
97//! let secret: yup_oauth2::ApplicationSecret = Default::default();
98//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
99//! // unless you replace `None` with the desired Flow.
100//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
101//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
102//! // retrieve them from storage.
103//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
104//! .with_native_roots()
105//! .unwrap()
106//! .https_only()
107//! .enable_http2()
108//! .build();
109//!
110//! let executor = hyper_util::rt::TokioExecutor::new();
111//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
112//! secret,
113//! yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
114//! yup_oauth2::client::CustomHyperClientBuilder::from(
115//! hyper_util::client::legacy::Client::builder(executor).build(connector),
116//! ),
117//! ).build().await.unwrap();
118//!
119//! let client = hyper_util::client::legacy::Client::builder(
120//! hyper_util::rt::TokioExecutor::new()
121//! )
122//! .build(
123//! hyper_rustls::HttpsConnectorBuilder::new()
124//! .with_native_roots()
125//! .unwrap()
126//! .https_or_http()
127//! .enable_http2()
128//! .build()
129//! );
130//! let mut hub = CertificateAuthorityService::new(client, auth);
131//! // You can configure optional parameters by calling the respective setters at will, and
132//! // execute the final call using `doit()`.
133//! // Values shown here are possibly random and not representative !
134//! let result = hub.projects().locations_ca_pools_certificate_authorities_delete("name")
135//! .skip_grace_period(true)
136//! .request_id("gubergren")
137//! .ignore_dependent_resources(true)
138//! .ignore_active_certificates(false)
139//! .doit().await;
140//!
141//! match result {
142//! Err(e) => match e {
143//! // The Error enum provides details about what exactly happened.
144//! // You can also just use its `Debug`, `Display` or `Error` traits
145//! Error::HttpError(_)
146//! |Error::Io(_)
147//! |Error::MissingAPIKey
148//! |Error::MissingToken(_)
149//! |Error::Cancelled
150//! |Error::UploadSizeLimitExceeded(_, _)
151//! |Error::Failure(_)
152//! |Error::BadRequest(_)
153//! |Error::FieldClash(_)
154//! |Error::JsonDecodeError(_, _) => println!("{}", e),
155//! },
156//! Ok(res) => println!("Success: {:?}", res),
157//! }
158//! # }
159//! ```
160//! ## Handling Errors
161//!
162//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
163//! the doit() methods, or handed as possibly intermediate results to either the
164//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
165//!
166//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
167//! makes the system potentially resilient to all kinds of errors.
168//!
169//! ## Uploads and Downloads
170//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
171//! read by you to obtain the media.
172//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
173//! 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
174//! this call: `.param("alt", "media")`.
175//!
176//! Methods supporting uploads can do so using up to 2 different protocols:
177//! *simple* and *resumable*. The distinctiveness of each is represented by customized
178//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
179//!
180//! ## Customization and Callbacks
181//!
182//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
183//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
184//! Respective methods will be called to provide progress information, as well as determine whether the system should
185//! retry on failure.
186//!
187//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
188//!
189//! ## Optional Parts in Server-Requests
190//!
191//! All structures provided by this library are made to be [encodable](common::RequestValue) and
192//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
193//! are valid.
194//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
195//! the server to indicate either the set parts of the request or the desired parts in the response.
196//!
197//! ## Builder Arguments
198//!
199//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
200//! These will always take a single argument, for which the following statements are true.
201//!
202//! * [PODs][wiki-pod] are handed by copy
203//! * strings are passed as `&str`
204//! * [request values](common::RequestValue) are moved
205//!
206//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
207//!
208//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
209//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
210//! [google-go-api]: https://github.com/google/google-api-go-client
211//!
212//! ## Cargo Features
213//!
214//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
215//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
216//! generated `openapi` spec would be invalid.
217//!
218//!
219//!
220
221// Unused attributes happen thanks to defined, but unused structures We don't
222// warn about this, as depending on the API, some data structures or facilities
223// are never used. Instead of pre-determining this, we just disable the lint.
224// It's manually tuned to not have any unused imports in fully featured APIs.
225// Same with unused_mut.
226#![allow(unused_imports, unused_mut, dead_code)]
227
228// DO NOT EDIT !
229// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
230// DO NOT EDIT !
231
232pub extern crate hyper;
233pub extern crate hyper_rustls;
234pub extern crate hyper_util;
235#[cfg(feature = "yup-oauth2")]
236pub extern crate yup_oauth2;
237
238pub extern crate google_apis_common as common;
239pub use common::{Delegate, Error, FieldMask, Result};
240
241pub mod api;
242pub use api::CertificateAuthorityService;