google_networkservices1/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 *NetworkServices* crate version *7.0.0+20251203*, where *20251203* is the exact revision of the *networkservices:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *NetworkServices* *v1* API can be found at the
8//! [official documentation site](https://cloud.google.com/networking).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/networkservices1).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](NetworkServices) ...
13//!
14//! * projects
15//! * [*locations authz extensions create*](api::ProjectLocationAuthzExtensionCreateCall), [*locations authz extensions delete*](api::ProjectLocationAuthzExtensionDeleteCall), [*locations authz extensions get*](api::ProjectLocationAuthzExtensionGetCall), [*locations authz extensions list*](api::ProjectLocationAuthzExtensionListCall), [*locations authz extensions patch*](api::ProjectLocationAuthzExtensionPatchCall), [*locations edge cache keysets get iam policy*](api::ProjectLocationEdgeCacheKeysetGetIamPolicyCall), [*locations edge cache keysets set iam policy*](api::ProjectLocationEdgeCacheKeysetSetIamPolicyCall), [*locations edge cache keysets test iam permissions*](api::ProjectLocationEdgeCacheKeysetTestIamPermissionCall), [*locations edge cache origins get iam policy*](api::ProjectLocationEdgeCacheOriginGetIamPolicyCall), [*locations edge cache origins set iam policy*](api::ProjectLocationEdgeCacheOriginSetIamPolicyCall), [*locations edge cache origins test iam permissions*](api::ProjectLocationEdgeCacheOriginTestIamPermissionCall), [*locations edge cache services get iam policy*](api::ProjectLocationEdgeCacheServiceGetIamPolicyCall), [*locations edge cache services set iam policy*](api::ProjectLocationEdgeCacheServiceSetIamPolicyCall), [*locations edge cache services test iam permissions*](api::ProjectLocationEdgeCacheServiceTestIamPermissionCall), [*locations endpoint policies create*](api::ProjectLocationEndpointPolicyCreateCall), [*locations endpoint policies delete*](api::ProjectLocationEndpointPolicyDeleteCall), [*locations endpoint policies get*](api::ProjectLocationEndpointPolicyGetCall), [*locations endpoint policies list*](api::ProjectLocationEndpointPolicyListCall), [*locations endpoint policies patch*](api::ProjectLocationEndpointPolicyPatchCall), [*locations gateways create*](api::ProjectLocationGatewayCreateCall), [*locations gateways delete*](api::ProjectLocationGatewayDeleteCall), [*locations gateways get*](api::ProjectLocationGatewayGetCall), [*locations gateways list*](api::ProjectLocationGatewayListCall), [*locations gateways patch*](api::ProjectLocationGatewayPatchCall), [*locations gateways route views get*](api::ProjectLocationGatewayRouteViewGetCall), [*locations gateways route views list*](api::ProjectLocationGatewayRouteViewListCall), [*locations get*](api::ProjectLocationGetCall), [*locations grpc routes create*](api::ProjectLocationGrpcRouteCreateCall), [*locations grpc routes delete*](api::ProjectLocationGrpcRouteDeleteCall), [*locations grpc routes get*](api::ProjectLocationGrpcRouteGetCall), [*locations grpc routes list*](api::ProjectLocationGrpcRouteListCall), [*locations grpc routes patch*](api::ProjectLocationGrpcRoutePatchCall), [*locations http routes create*](api::ProjectLocationHttpRouteCreateCall), [*locations http routes delete*](api::ProjectLocationHttpRouteDeleteCall), [*locations http routes get*](api::ProjectLocationHttpRouteGetCall), [*locations http routes list*](api::ProjectLocationHttpRouteListCall), [*locations http routes patch*](api::ProjectLocationHttpRoutePatchCall), [*locations lb edge extensions create*](api::ProjectLocationLbEdgeExtensionCreateCall), [*locations lb edge extensions delete*](api::ProjectLocationLbEdgeExtensionDeleteCall), [*locations lb edge extensions get*](api::ProjectLocationLbEdgeExtensionGetCall), [*locations lb edge extensions list*](api::ProjectLocationLbEdgeExtensionListCall), [*locations lb edge extensions patch*](api::ProjectLocationLbEdgeExtensionPatchCall), [*locations lb route extensions create*](api::ProjectLocationLbRouteExtensionCreateCall), [*locations lb route extensions delete*](api::ProjectLocationLbRouteExtensionDeleteCall), [*locations lb route extensions get*](api::ProjectLocationLbRouteExtensionGetCall), [*locations lb route extensions list*](api::ProjectLocationLbRouteExtensionListCall), [*locations lb route extensions patch*](api::ProjectLocationLbRouteExtensionPatchCall), [*locations lb traffic extensions create*](api::ProjectLocationLbTrafficExtensionCreateCall), [*locations lb traffic extensions delete*](api::ProjectLocationLbTrafficExtensionDeleteCall), [*locations lb traffic extensions get*](api::ProjectLocationLbTrafficExtensionGetCall), [*locations lb traffic extensions list*](api::ProjectLocationLbTrafficExtensionListCall), [*locations lb traffic extensions patch*](api::ProjectLocationLbTrafficExtensionPatchCall), [*locations list*](api::ProjectLocationListCall), [*locations meshes create*](api::ProjectLocationMeshCreateCall), [*locations meshes delete*](api::ProjectLocationMeshDeleteCall), [*locations meshes get*](api::ProjectLocationMeshGetCall), [*locations meshes list*](api::ProjectLocationMeshListCall), [*locations meshes patch*](api::ProjectLocationMeshPatchCall), [*locations meshes route views get*](api::ProjectLocationMeshRouteViewGetCall), [*locations meshes route views list*](api::ProjectLocationMeshRouteViewListCall), [*locations operations cancel*](api::ProjectLocationOperationCancelCall), [*locations operations delete*](api::ProjectLocationOperationDeleteCall), [*locations operations get*](api::ProjectLocationOperationGetCall), [*locations operations list*](api::ProjectLocationOperationListCall), [*locations service bindings create*](api::ProjectLocationServiceBindingCreateCall), [*locations service bindings delete*](api::ProjectLocationServiceBindingDeleteCall), [*locations service bindings get*](api::ProjectLocationServiceBindingGetCall), [*locations service bindings list*](api::ProjectLocationServiceBindingListCall), [*locations service bindings patch*](api::ProjectLocationServiceBindingPatchCall), [*locations service lb policies create*](api::ProjectLocationServiceLbPolicyCreateCall), [*locations service lb policies delete*](api::ProjectLocationServiceLbPolicyDeleteCall), [*locations service lb policies get*](api::ProjectLocationServiceLbPolicyGetCall), [*locations service lb policies list*](api::ProjectLocationServiceLbPolicyListCall), [*locations service lb policies patch*](api::ProjectLocationServiceLbPolicyPatchCall), [*locations tcp routes create*](api::ProjectLocationTcpRouteCreateCall), [*locations tcp routes delete*](api::ProjectLocationTcpRouteDeleteCall), [*locations tcp routes get*](api::ProjectLocationTcpRouteGetCall), [*locations tcp routes list*](api::ProjectLocationTcpRouteListCall), [*locations tcp routes patch*](api::ProjectLocationTcpRoutePatchCall), [*locations tls routes create*](api::ProjectLocationTlsRouteCreateCall), [*locations tls routes delete*](api::ProjectLocationTlsRouteDeleteCall), [*locations tls routes get*](api::ProjectLocationTlsRouteGetCall), [*locations tls routes list*](api::ProjectLocationTlsRouteListCall), [*locations tls routes patch*](api::ProjectLocationTlsRoutePatchCall), [*locations wasm plugins create*](api::ProjectLocationWasmPluginCreateCall), [*locations wasm plugins delete*](api::ProjectLocationWasmPluginDeleteCall), [*locations wasm plugins get*](api::ProjectLocationWasmPluginGetCall), [*locations wasm plugins list*](api::ProjectLocationWasmPluginListCall), [*locations wasm plugins patch*](api::ProjectLocationWasmPluginPatchCall), [*locations wasm plugins versions create*](api::ProjectLocationWasmPluginVersionCreateCall), [*locations wasm plugins versions delete*](api::ProjectLocationWasmPluginVersionDeleteCall), [*locations wasm plugins versions get*](api::ProjectLocationWasmPluginVersionGetCall) and [*locations wasm plugins versions list*](api::ProjectLocationWasmPluginVersionListCall)
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](NetworkServices)**
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_authz_extensions_create(...).doit().await
51//! let r = hub.projects().locations_authz_extensions_delete(...).doit().await
52//! let r = hub.projects().locations_authz_extensions_patch(...).doit().await
53//! let r = hub.projects().locations_endpoint_policies_create(...).doit().await
54//! let r = hub.projects().locations_endpoint_policies_delete(...).doit().await
55//! let r = hub.projects().locations_endpoint_policies_patch(...).doit().await
56//! let r = hub.projects().locations_gateways_create(...).doit().await
57//! let r = hub.projects().locations_gateways_delete(...).doit().await
58//! let r = hub.projects().locations_gateways_patch(...).doit().await
59//! let r = hub.projects().locations_grpc_routes_create(...).doit().await
60//! let r = hub.projects().locations_grpc_routes_delete(...).doit().await
61//! let r = hub.projects().locations_grpc_routes_patch(...).doit().await
62//! let r = hub.projects().locations_http_routes_create(...).doit().await
63//! let r = hub.projects().locations_http_routes_delete(...).doit().await
64//! let r = hub.projects().locations_http_routes_patch(...).doit().await
65//! let r = hub.projects().locations_lb_edge_extensions_create(...).doit().await
66//! let r = hub.projects().locations_lb_edge_extensions_delete(...).doit().await
67//! let r = hub.projects().locations_lb_edge_extensions_patch(...).doit().await
68//! let r = hub.projects().locations_lb_route_extensions_create(...).doit().await
69//! let r = hub.projects().locations_lb_route_extensions_delete(...).doit().await
70//! let r = hub.projects().locations_lb_route_extensions_patch(...).doit().await
71//! let r = hub.projects().locations_lb_traffic_extensions_create(...).doit().await
72//! let r = hub.projects().locations_lb_traffic_extensions_delete(...).doit().await
73//! let r = hub.projects().locations_lb_traffic_extensions_patch(...).doit().await
74//! let r = hub.projects().locations_meshes_create(...).doit().await
75//! let r = hub.projects().locations_meshes_delete(...).doit().await
76//! let r = hub.projects().locations_meshes_patch(...).doit().await
77//! let r = hub.projects().locations_operations_get(...).doit().await
78//! let r = hub.projects().locations_service_bindings_create(...).doit().await
79//! let r = hub.projects().locations_service_bindings_delete(...).doit().await
80//! let r = hub.projects().locations_service_bindings_patch(...).doit().await
81//! let r = hub.projects().locations_service_lb_policies_create(...).doit().await
82//! let r = hub.projects().locations_service_lb_policies_delete(...).doit().await
83//! let r = hub.projects().locations_service_lb_policies_patch(...).doit().await
84//! let r = hub.projects().locations_tcp_routes_create(...).doit().await
85//! let r = hub.projects().locations_tcp_routes_delete(...).doit().await
86//! let r = hub.projects().locations_tcp_routes_patch(...).doit().await
87//! let r = hub.projects().locations_tls_routes_create(...).doit().await
88//! let r = hub.projects().locations_tls_routes_delete(...).doit().await
89//! let r = hub.projects().locations_tls_routes_patch(...).doit().await
90//! let r = hub.projects().locations_wasm_plugins_versions_create(...).doit().await
91//! let r = hub.projects().locations_wasm_plugins_versions_delete(...).doit().await
92//! let r = hub.projects().locations_wasm_plugins_create(...).doit().await
93//! let r = hub.projects().locations_wasm_plugins_delete(...).doit().await
94//! let r = hub.projects().locations_wasm_plugins_patch(...).doit().await
95//! ```
96//!
97//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
98//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
99//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
100//! The `doit()` method performs the actual communication with the server and returns the respective result.
101//!
102//! # Usage
103//!
104//! ## Setting up your Project
105//!
106//! To use this library, you would put the following lines into your `Cargo.toml` file:
107//!
108//! ```toml
109//! [dependencies]
110//! google-networkservices1 = "*"
111//! serde = "1"
112//! serde_json = "1"
113//! ```
114//!
115//! ## A complete example
116//!
117//! ```test_harness,no_run
118//! extern crate hyper;
119//! extern crate hyper_rustls;
120//! extern crate google_networkservices1 as networkservices1;
121//! use networkservices1::api::AuthzExtension;
122//! use networkservices1::{Result, Error};
123//! # async fn dox() {
124//! use networkservices1::{NetworkServices, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
125//!
126//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
127//! // `client_secret`, among other things.
128//! let secret: yup_oauth2::ApplicationSecret = Default::default();
129//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
130//! // unless you replace `None` with the desired Flow.
131//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
132//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
133//! // retrieve them from storage.
134//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
135//! .with_native_roots()
136//! .unwrap()
137//! .https_only()
138//! .enable_http2()
139//! .build();
140//!
141//! let executor = hyper_util::rt::TokioExecutor::new();
142//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
143//! secret,
144//! yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
145//! yup_oauth2::client::CustomHyperClientBuilder::from(
146//! hyper_util::client::legacy::Client::builder(executor).build(connector),
147//! ),
148//! ).build().await.unwrap();
149//!
150//! let client = hyper_util::client::legacy::Client::builder(
151//! hyper_util::rt::TokioExecutor::new()
152//! )
153//! .build(
154//! hyper_rustls::HttpsConnectorBuilder::new()
155//! .with_native_roots()
156//! .unwrap()
157//! .https_or_http()
158//! .enable_http2()
159//! .build()
160//! );
161//! let mut hub = NetworkServices::new(client, auth);
162//! // As the method needs a request, you would usually fill it with the desired information
163//! // into the respective structure. Some of the parts shown here might not be applicable !
164//! // Values shown here are possibly random and not representative !
165//! let mut req = AuthzExtension::default();
166//!
167//! // You can configure optional parameters by calling the respective setters at will, and
168//! // execute the final call using `doit()`.
169//! // Values shown here are possibly random and not representative !
170//! let result = hub.projects().locations_authz_extensions_create(req, "parent")
171//! .request_id("voluptua.")
172//! .authz_extension_id("At")
173//! .doit().await;
174//!
175//! match result {
176//! Err(e) => match e {
177//! // The Error enum provides details about what exactly happened.
178//! // You can also just use its `Debug`, `Display` or `Error` traits
179//! Error::HttpError(_)
180//! |Error::Io(_)
181//! |Error::MissingAPIKey
182//! |Error::MissingToken(_)
183//! |Error::Cancelled
184//! |Error::UploadSizeLimitExceeded(_, _)
185//! |Error::Failure(_)
186//! |Error::BadRequest(_)
187//! |Error::FieldClash(_)
188//! |Error::JsonDecodeError(_, _) => println!("{}", e),
189//! },
190//! Ok(res) => println!("Success: {:?}", res),
191//! }
192//! # }
193//! ```
194//! ## Handling Errors
195//!
196//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
197//! the doit() methods, or handed as possibly intermediate results to either the
198//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
199//!
200//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
201//! makes the system potentially resilient to all kinds of errors.
202//!
203//! ## Uploads and Downloads
204//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
205//! read by you to obtain the media.
206//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
207//! 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
208//! this call: `.param("alt", "media")`.
209//!
210//! Methods supporting uploads can do so using up to 2 different protocols:
211//! *simple* and *resumable*. The distinctiveness of each is represented by customized
212//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
213//!
214//! ## Customization and Callbacks
215//!
216//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
217//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
218//! Respective methods will be called to provide progress information, as well as determine whether the system should
219//! retry on failure.
220//!
221//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
222//!
223//! ## Optional Parts in Server-Requests
224//!
225//! All structures provided by this library are made to be [encodable](common::RequestValue) and
226//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
227//! are valid.
228//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
229//! the server to indicate either the set parts of the request or the desired parts in the response.
230//!
231//! ## Builder Arguments
232//!
233//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
234//! These will always take a single argument, for which the following statements are true.
235//!
236//! * [PODs][wiki-pod] are handed by copy
237//! * strings are passed as `&str`
238//! * [request values](common::RequestValue) are moved
239//!
240//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
241//!
242//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
243//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
244//! [google-go-api]: https://github.com/google/google-api-go-client
245//!
246//! ## Cargo Features
247//!
248//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
249//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
250//! generated `openapi` spec would be invalid.
251//!
252//!
253//!
254
255// Unused attributes happen thanks to defined, but unused structures We don't
256// warn about this, as depending on the API, some data structures or facilities
257// are never used. Instead of pre-determining this, we just disable the lint.
258// It's manually tuned to not have any unused imports in fully featured APIs.
259// Same with unused_mut.
260#![allow(unused_imports, unused_mut, dead_code)]
261
262// DO NOT EDIT !
263// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
264// DO NOT EDIT !
265
266pub extern crate hyper;
267pub extern crate hyper_rustls;
268pub extern crate hyper_util;
269#[cfg(feature = "yup-oauth2")]
270pub extern crate yup_oauth2;
271
272pub extern crate google_apis_common as common;
273pub use common::{Delegate, Error, FieldMask, Result};
274
275pub mod api;
276pub use api::NetworkServices;